@farcaster/frame-core 0.1.10 → 0.3.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.
Files changed (142) hide show
  1. package/dist/index.d.ts +153 -10
  2. package/dist/index.js +18 -33
  3. package/esm/index.d.ts +153 -10
  4. package/esm/index.js +17 -10
  5. package/esm/tsconfig.tsbuildinfo +1 -1
  6. package/package.json +6 -8
  7. package/src/index.ts +50 -10
  8. package/dist/actions/AddMiniApp.d.ts +0 -36
  9. package/dist/actions/AddMiniApp.js +0 -57
  10. package/dist/actions/ComposeCast.d.ts +0 -37
  11. package/dist/actions/ComposeCast.js +0 -2
  12. package/dist/actions/Haptics.d.ts +0 -5
  13. package/dist/actions/Haptics.js +0 -2
  14. package/dist/actions/Ready.d.ts +0 -13
  15. package/dist/actions/Ready.js +0 -6
  16. package/dist/actions/SendToken.d.ts +0 -48
  17. package/dist/actions/SendToken.js +0 -2
  18. package/dist/actions/SignIn.d.ts +0 -55
  19. package/dist/actions/SignIn.js +0 -47
  20. package/dist/actions/SwapToken.d.ts +0 -46
  21. package/dist/actions/SwapToken.js +0 -2
  22. package/dist/actions/ViewCast.d.ts +0 -25
  23. package/dist/actions/ViewCast.js +0 -2
  24. package/dist/actions/ViewProfile.d.ts +0 -4
  25. package/dist/actions/ViewProfile.js +0 -2
  26. package/dist/actions/ViewToken.d.ts +0 -4
  27. package/dist/actions/ViewToken.js +0 -2
  28. package/dist/actions/index.d.ts +0 -10
  29. package/dist/actions/index.js +0 -46
  30. package/dist/back.d.ts +0 -13
  31. package/dist/back.js +0 -6
  32. package/dist/context.d.ts +0 -94
  33. package/dist/context.js +0 -2
  34. package/dist/errors.d.ts +0 -13
  35. package/dist/errors.js +0 -12
  36. package/dist/internal/types.d.ts +0 -8
  37. package/dist/internal/types.js +0 -2
  38. package/dist/manifest.d.ts +0 -101
  39. package/dist/manifest.js +0 -2
  40. package/dist/schemas/embeds.d.ts +0 -243
  41. package/dist/schemas/embeds.js +0 -32
  42. package/dist/schemas/events.d.ts +0 -131
  43. package/dist/schemas/events.js +0 -25
  44. package/dist/schemas/index.d.ts +0 -5
  45. package/dist/schemas/index.js +0 -21
  46. package/dist/schemas/manifest.d.ts +0 -334
  47. package/dist/schemas/manifest.js +0 -112
  48. package/dist/schemas/notifications.d.ts +0 -60
  49. package/dist/schemas/notifications.js +0 -23
  50. package/dist/schemas/shared.d.ts +0 -39
  51. package/dist/schemas/shared.js +0 -58
  52. package/dist/solana.d.ts +0 -72
  53. package/dist/solana.js +0 -15
  54. package/dist/solanaWire.d.ts +0 -3
  55. package/dist/solanaWire.js +0 -84
  56. package/dist/types.d.ts +0 -87
  57. package/dist/types.js +0 -41
  58. package/dist/wallet/ethereum.d.ts +0 -47
  59. package/dist/wallet/ethereum.js +0 -2
  60. package/dist/wallet/index.d.ts +0 -1
  61. package/dist/wallet/index.js +0 -37
  62. package/esm/actions/AddMiniApp.d.ts +0 -36
  63. package/esm/actions/AddMiniApp.js +0 -19
  64. package/esm/actions/ComposeCast.d.ts +0 -37
  65. package/esm/actions/ComposeCast.js +0 -1
  66. package/esm/actions/Haptics.d.ts +0 -5
  67. package/esm/actions/Haptics.js +0 -1
  68. package/esm/actions/Ready.d.ts +0 -13
  69. package/esm/actions/Ready.js +0 -3
  70. package/esm/actions/SendToken.d.ts +0 -48
  71. package/esm/actions/SendToken.js +0 -1
  72. package/esm/actions/SignIn.d.ts +0 -55
  73. package/esm/actions/SignIn.js +0 -10
  74. package/esm/actions/SwapToken.d.ts +0 -46
  75. package/esm/actions/SwapToken.js +0 -1
  76. package/esm/actions/ViewCast.d.ts +0 -25
  77. package/esm/actions/ViewCast.js +0 -1
  78. package/esm/actions/ViewProfile.d.ts +0 -4
  79. package/esm/actions/ViewProfile.js +0 -1
  80. package/esm/actions/ViewToken.d.ts +0 -4
  81. package/esm/actions/ViewToken.js +0 -1
  82. package/esm/actions/index.d.ts +0 -10
  83. package/esm/actions/index.js +0 -10
  84. package/esm/back.d.ts +0 -13
  85. package/esm/back.js +0 -3
  86. package/esm/context.d.ts +0 -94
  87. package/esm/context.js +0 -1
  88. package/esm/errors.d.ts +0 -13
  89. package/esm/errors.js +0 -8
  90. package/esm/internal/types.d.ts +0 -8
  91. package/esm/internal/types.js +0 -1
  92. package/esm/manifest.d.ts +0 -101
  93. package/esm/manifest.js +0 -1
  94. package/esm/schemas/embeds.d.ts +0 -243
  95. package/esm/schemas/embeds.js +0 -28
  96. package/esm/schemas/events.d.ts +0 -131
  97. package/esm/schemas/events.js +0 -22
  98. package/esm/schemas/index.d.ts +0 -5
  99. package/esm/schemas/index.js +0 -5
  100. package/esm/schemas/manifest.d.ts +0 -334
  101. package/esm/schemas/manifest.js +0 -109
  102. package/esm/schemas/notifications.d.ts +0 -60
  103. package/esm/schemas/notifications.js +0 -20
  104. package/esm/schemas/shared.d.ts +0 -39
  105. package/esm/schemas/shared.js +0 -54
  106. package/esm/solana.d.ts +0 -72
  107. package/esm/solana.js +0 -11
  108. package/esm/solanaWire.d.ts +0 -3
  109. package/esm/solanaWire.js +0 -80
  110. package/esm/types.d.ts +0 -87
  111. package/esm/types.js +0 -23
  112. package/esm/wallet/ethereum.d.ts +0 -47
  113. package/esm/wallet/ethereum.js +0 -1
  114. package/esm/wallet/index.d.ts +0 -1
  115. package/esm/wallet/index.js +0 -1
  116. package/src/actions/AddMiniApp.ts +0 -51
  117. package/src/actions/ComposeCast.ts +0 -44
  118. package/src/actions/Haptics.ts +0 -9
  119. package/src/actions/Ready.ts +0 -15
  120. package/src/actions/SendToken.ts +0 -57
  121. package/src/actions/SignIn.ts +0 -67
  122. package/src/actions/SwapToken.ts +0 -54
  123. package/src/actions/ViewCast.ts +0 -27
  124. package/src/actions/ViewProfile.ts +0 -5
  125. package/src/actions/ViewToken.ts +0 -5
  126. package/src/actions/index.ts +0 -10
  127. package/src/back.ts +0 -15
  128. package/src/context.ts +0 -117
  129. package/src/errors.ts +0 -21
  130. package/src/internal/types.ts +0 -20
  131. package/src/manifest.ts +0 -113
  132. package/src/schemas/embeds.ts +0 -44
  133. package/src/schemas/events.ts +0 -41
  134. package/src/schemas/index.ts +0 -5
  135. package/src/schemas/manifest.ts +0 -122
  136. package/src/schemas/notifications.ts +0 -33
  137. package/src/schemas/shared.ts +0 -81
  138. package/src/solana.ts +0 -108
  139. package/src/solanaWire.ts +0 -120
  140. package/src/types.ts +0 -155
  141. package/src/wallet/ethereum.ts +0 -65
  142. package/src/wallet/index.ts +0 -1
@@ -1,334 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const domainFrameConfigSchema: z.ZodEffects<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
- /** deprecated, set ogImageUrl instead */
8
- imageUrl: z.ZodOptional<z.ZodString>;
9
- /** deprecated, will rely on fc:frame meta tag */
10
- buttonTitle: z.ZodOptional<z.ZodString>;
11
- splashImageUrl: z.ZodOptional<z.ZodString>;
12
- splashBackgroundColor: z.ZodOptional<z.ZodString>;
13
- webhookUrl: z.ZodOptional<z.ZodString>;
14
- /** see: https://github.com/farcasterxyz/miniapps/discussions/191 */
15
- subtitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
16
- description: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
17
- screenshotUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
18
- primaryCategory: z.ZodOptional<z.ZodEnum<["games", "social", "finance", "utility", "productivity", "health-fitness", "news-media", "music", "shopping", "education", "developer-tools", "entertainment", "art-creativity"]>>;
19
- tags: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, "many">>;
20
- heroImageUrl: z.ZodOptional<z.ZodString>;
21
- tagline: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
22
- ogTitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
23
- ogDescription: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
24
- ogImageUrl: z.ZodOptional<z.ZodString>;
25
- /** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
26
- noindex: z.ZodOptional<z.ZodBoolean>;
27
- /** see https://github.com/farcasterxyz/miniapps/discussions/256 */
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
- /** see https://github.com/farcasterxyz/miniapps/discussions/158 */
31
- /** Documentation will be added once this feature is finalized. */
32
- castShareUrl: z.ZodOptional<z.ZodString>;
33
- }, "strip", z.ZodTypeAny, {
34
- name: string;
35
- version: "1" | "next" | "0.0.0" | "0.0.1";
36
- iconUrl: string;
37
- homeUrl: string;
38
- splashImageUrl?: string | undefined;
39
- splashBackgroundColor?: string | undefined;
40
- imageUrl?: string | undefined;
41
- buttonTitle?: string | undefined;
42
- webhookUrl?: string | undefined;
43
- subtitle?: string | undefined;
44
- description?: string | undefined;
45
- screenshotUrls?: string[] | undefined;
46
- primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
47
- tags?: string[] | undefined;
48
- heroImageUrl?: string | undefined;
49
- tagline?: string | undefined;
50
- ogTitle?: string | undefined;
51
- ogDescription?: string | undefined;
52
- ogImageUrl?: string | undefined;
53
- noindex?: boolean | undefined;
54
- 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;
55
- 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
- castShareUrl?: string | undefined;
57
- }, {
58
- name: string;
59
- version: "1" | "next" | "0.0.0" | "0.0.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
- subtitle?: string | undefined;
68
- description?: string | undefined;
69
- screenshotUrls?: string[] | undefined;
70
- primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
71
- tags?: string[] | undefined;
72
- heroImageUrl?: string | undefined;
73
- tagline?: string | undefined;
74
- ogTitle?: string | undefined;
75
- ogDescription?: string | undefined;
76
- ogImageUrl?: string | undefined;
77
- noindex?: boolean | undefined;
78
- 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;
79
- 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
- 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?: ("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;
103
- 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
- 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?: ("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;
127
- 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
- castShareUrl?: string | undefined;
129
- }>;
130
- export declare const domainManifestSchema: z.ZodObject<{
131
- accountAssociation: z.ZodObject<{
132
- header: z.ZodString;
133
- payload: z.ZodString;
134
- signature: z.ZodString;
135
- }, "strip", z.ZodTypeAny, {
136
- header: string;
137
- payload: string;
138
- signature: string;
139
- }, {
140
- header: string;
141
- payload: string;
142
- signature: string;
143
- }>;
144
- frame: z.ZodOptional<z.ZodEffects<z.ZodObject<{
145
- version: z.ZodUnion<[z.ZodLiteral<"0.0.0">, z.ZodLiteral<"0.0.1">, z.ZodLiteral<"1">, z.ZodLiteral<"next">]>;
146
- name: z.ZodString;
147
- iconUrl: z.ZodString;
148
- homeUrl: z.ZodString;
149
- /** deprecated, set ogImageUrl instead */
150
- imageUrl: z.ZodOptional<z.ZodString>;
151
- /** deprecated, will rely on fc:frame meta tag */
152
- buttonTitle: z.ZodOptional<z.ZodString>;
153
- splashImageUrl: z.ZodOptional<z.ZodString>;
154
- splashBackgroundColor: z.ZodOptional<z.ZodString>;
155
- webhookUrl: z.ZodOptional<z.ZodString>;
156
- /** see: https://github.com/farcasterxyz/miniapps/discussions/191 */
157
- subtitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
158
- description: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
159
- screenshotUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
160
- primaryCategory: z.ZodOptional<z.ZodEnum<["games", "social", "finance", "utility", "productivity", "health-fitness", "news-media", "music", "shopping", "education", "developer-tools", "entertainment", "art-creativity"]>>;
161
- tags: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, "many">>;
162
- heroImageUrl: z.ZodOptional<z.ZodString>;
163
- tagline: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
164
- ogTitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
165
- ogDescription: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
166
- ogImageUrl: z.ZodOptional<z.ZodString>;
167
- /** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
168
- noindex: z.ZodOptional<z.ZodBoolean>;
169
- /** see https://github.com/farcasterxyz/miniapps/discussions/256 */
170
- 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")[]>>;
171
- 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
- /** see https://github.com/farcasterxyz/miniapps/discussions/158 */
173
- /** Documentation will be added once this feature is finalized. */
174
- castShareUrl: z.ZodOptional<z.ZodString>;
175
- }, "strip", z.ZodTypeAny, {
176
- name: string;
177
- version: "1" | "next" | "0.0.0" | "0.0.1";
178
- iconUrl: string;
179
- homeUrl: string;
180
- splashImageUrl?: string | undefined;
181
- splashBackgroundColor?: string | undefined;
182
- imageUrl?: string | undefined;
183
- buttonTitle?: string | undefined;
184
- webhookUrl?: string | undefined;
185
- subtitle?: string | undefined;
186
- description?: string | undefined;
187
- screenshotUrls?: string[] | undefined;
188
- primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
189
- tags?: string[] | undefined;
190
- heroImageUrl?: string | undefined;
191
- tagline?: string | undefined;
192
- ogTitle?: string | undefined;
193
- ogDescription?: string | undefined;
194
- ogImageUrl?: string | undefined;
195
- noindex?: boolean | undefined;
196
- 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;
197
- 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
- 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?: ("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;
221
- 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
- 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?: ("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;
245
- 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
- castShareUrl?: string | undefined;
247
- }, {
248
- name: string;
249
- version: "1" | "next" | "0.0.0" | "0.0.1";
250
- iconUrl: string;
251
- homeUrl: string;
252
- splashImageUrl?: string | undefined;
253
- splashBackgroundColor?: string | undefined;
254
- imageUrl?: string | undefined;
255
- buttonTitle?: string | undefined;
256
- webhookUrl?: string | undefined;
257
- subtitle?: string | undefined;
258
- description?: string | undefined;
259
- screenshotUrls?: string[] | undefined;
260
- primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
261
- tags?: string[] | undefined;
262
- heroImageUrl?: string | undefined;
263
- tagline?: string | undefined;
264
- ogTitle?: string | undefined;
265
- ogDescription?: string | undefined;
266
- ogImageUrl?: string | undefined;
267
- noindex?: boolean | undefined;
268
- 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;
269
- 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
- castShareUrl?: string | undefined;
271
- }>>;
272
- }, "strip", z.ZodTypeAny, {
273
- accountAssociation: {
274
- header: string;
275
- payload: string;
276
- signature: string;
277
- };
278
- frame?: {
279
- name: string;
280
- version: "1" | "next" | "0.0.0" | "0.0.1";
281
- iconUrl: string;
282
- homeUrl: string;
283
- splashImageUrl?: string | undefined;
284
- splashBackgroundColor?: string | undefined;
285
- imageUrl?: string | undefined;
286
- buttonTitle?: string | undefined;
287
- webhookUrl?: string | undefined;
288
- subtitle?: string | undefined;
289
- description?: string | undefined;
290
- screenshotUrls?: string[] | undefined;
291
- primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
292
- tags?: string[] | undefined;
293
- heroImageUrl?: string | undefined;
294
- tagline?: string | undefined;
295
- ogTitle?: string | undefined;
296
- ogDescription?: string | undefined;
297
- ogImageUrl?: string | undefined;
298
- noindex?: boolean | undefined;
299
- 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;
300
- 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
- castShareUrl?: string | undefined;
302
- } | undefined;
303
- }, {
304
- accountAssociation: {
305
- header: string;
306
- payload: string;
307
- signature: string;
308
- };
309
- frame?: {
310
- name: string;
311
- version: "1" | "next" | "0.0.0" | "0.0.1";
312
- iconUrl: string;
313
- homeUrl: string;
314
- splashImageUrl?: string | undefined;
315
- splashBackgroundColor?: string | undefined;
316
- imageUrl?: string | undefined;
317
- buttonTitle?: string | undefined;
318
- webhookUrl?: string | undefined;
319
- subtitle?: string | undefined;
320
- description?: string | undefined;
321
- screenshotUrls?: string[] | undefined;
322
- primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
323
- tags?: string[] | undefined;
324
- heroImageUrl?: string | undefined;
325
- tagline?: string | undefined;
326
- ogTitle?: string | undefined;
327
- ogDescription?: string | undefined;
328
- ogImageUrl?: string | undefined;
329
- noindex?: boolean | undefined;
330
- 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;
331
- 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
- castShareUrl?: string | undefined;
333
- } | undefined;
334
- }>;
@@ -1,112 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.domainManifestSchema = exports.domainFrameConfigSchema = void 0;
4
- const zod_1 = require("zod");
5
- const types_ts_1 = require("../types.js");
6
- const shared_ts_1 = require("./shared.js");
7
- const primaryCategorySchema = zod_1.z.enum([
8
- 'games',
9
- 'social',
10
- 'finance',
11
- 'utility',
12
- 'productivity',
13
- 'health-fitness',
14
- 'news-media',
15
- 'music',
16
- 'shopping',
17
- 'education',
18
- 'developer-tools',
19
- 'entertainment',
20
- 'art-creativity',
21
- ]);
22
- const chainList = [
23
- 'eip155:1', // Ethereum mainnet
24
- 'eip155:8453', // Base mainnet
25
- 'eip155:42161', // Arbitrum One
26
- 'eip155:421614', // Arbitrum Sepolia
27
- 'eip155:84532', // Base Sepolia
28
- 'eip155:666666666', // Degen
29
- 'eip155:100', // Gnosis
30
- 'eip155:10', // Optimism
31
- 'eip155:11155420', // Optimism Sepolia
32
- 'eip155:137', // Polygon
33
- 'eip155:11155111', // Ethereum Sepolia
34
- 'eip155:7777777', // Zora
35
- 'eip155:130', // Unichain
36
- 'eip155:10143', // Monad testnet
37
- 'eip155:42220', // Celo
38
- 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp', // Solana
39
- ];
40
- function removeArrayDuplicates(arr) {
41
- const set = new Set(arr);
42
- return Array.from(set);
43
- }
44
- exports.domainFrameConfigSchema = zod_1.z
45
- .object({
46
- // 0.0.0 and 0.0.1 are not technically part of the spec but kept for
47
- // backwards compatibility. next should always resolve to the most recent
48
- // schema version.
49
- version: zod_1.z.union([
50
- zod_1.z.literal('0.0.0'),
51
- zod_1.z.literal('0.0.1'),
52
- zod_1.z.literal('1'),
53
- zod_1.z.literal('next'),
54
- ]),
55
- name: shared_ts_1.frameNameSchema,
56
- iconUrl: shared_ts_1.secureUrlSchema,
57
- homeUrl: shared_ts_1.secureUrlSchema,
58
- /** deprecated, set ogImageUrl instead */
59
- imageUrl: shared_ts_1.secureUrlSchema.optional(),
60
- /** deprecated, will rely on fc:frame meta tag */
61
- buttonTitle: shared_ts_1.buttonTitleSchema.optional(),
62
- splashImageUrl: shared_ts_1.secureUrlSchema.optional(),
63
- splashBackgroundColor: shared_ts_1.hexColorSchema.optional(),
64
- webhookUrl: shared_ts_1.secureUrlSchema.optional(),
65
- /** see: https://github.com/farcasterxyz/miniapps/discussions/191 */
66
- subtitle: (0, shared_ts_1.createSimpleStringSchema)({ max: 30 }).optional(),
67
- description: (0, shared_ts_1.createSimpleStringSchema)({ max: 170 }).optional(),
68
- screenshotUrls: zod_1.z.array(shared_ts_1.secureUrlSchema).max(3).optional(),
69
- primaryCategory: primaryCategorySchema.optional(),
70
- tags: zod_1.z
71
- .array((0, shared_ts_1.createSimpleStringSchema)({ max: 20, noSpaces: true }))
72
- .max(5)
73
- .optional(),
74
- heroImageUrl: shared_ts_1.secureUrlSchema.optional(),
75
- tagline: (0, shared_ts_1.createSimpleStringSchema)({ max: 30 }).optional(),
76
- ogTitle: (0, shared_ts_1.createSimpleStringSchema)({ max: 30 }).optional(),
77
- ogDescription: (0, shared_ts_1.createSimpleStringSchema)({ max: 100 }).optional(),
78
- ogImageUrl: shared_ts_1.secureUrlSchema.optional(),
79
- /** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
80
- noindex: zod_1.z.boolean().optional(),
81
- /** see https://github.com/farcasterxyz/miniapps/discussions/256 */
82
- requiredChains: zod_1.z
83
- .array(zod_1.z.enum(chainList))
84
- .transform(removeArrayDuplicates)
85
- .optional(),
86
- requiredCapabilities: zod_1.z
87
- .array(zod_1.z.enum(types_ts_1.miniAppHostCapabilityList))
88
- .transform(removeArrayDuplicates)
89
- .optional(),
90
- /** see https://github.com/farcasterxyz/miniapps/discussions/158 */
91
- /** Documentation will be added once this feature is finalized. */
92
- castShareUrl: shared_ts_1.secureUrlSchema.optional(),
93
- })
94
- .refine((data) => {
95
- if (data.castShareUrl === undefined)
96
- return true;
97
- try {
98
- const homeUrlDomain = new URL(data.homeUrl).hostname;
99
- const castShareUrlDomain = new URL(data.castShareUrl).hostname;
100
- return homeUrlDomain === castShareUrlDomain;
101
- }
102
- catch {
103
- return false;
104
- }
105
- }, {
106
- message: 'castShareUrl must have the same domain as homeUrl',
107
- path: ['castShareUrl'],
108
- });
109
- exports.domainManifestSchema = zod_1.z.object({
110
- accountAssociation: shared_ts_1.encodedJsonFarcasterSignatureSchema,
111
- frame: exports.domainFrameConfigSchema.optional(),
112
- });
@@ -1,60 +0,0 @@
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, {
48
- result: {
49
- successfulTokens: string[];
50
- invalidTokens: string[];
51
- rateLimitedTokens: string[];
52
- };
53
- }, {
54
- result: {
55
- successfulTokens: string[];
56
- invalidTokens: string[];
57
- rateLimitedTokens: string[];
58
- };
59
- }>;
60
- export type SendNotificationResponse = z.infer<typeof sendNotificationResponseSchema>;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sendNotificationResponseSchema = exports.sendNotificationRequestSchema = exports.notificationDetailsSchema = void 0;
4
- const zod_1 = require("zod");
5
- const shared_ts_1 = require("./shared.js");
6
- exports.notificationDetailsSchema = zod_1.z.object({
7
- url: zod_1.z.string(),
8
- token: zod_1.z.string(),
9
- });
10
- exports.sendNotificationRequestSchema = zod_1.z.object({
11
- notificationId: zod_1.z.string().max(128),
12
- title: zod_1.z.string().max(32),
13
- body: zod_1.z.string().max(128),
14
- targetUrl: shared_ts_1.secureUrlSchema,
15
- tokens: zod_1.z.string().array().max(100),
16
- });
17
- exports.sendNotificationResponseSchema = zod_1.z.object({
18
- result: zod_1.z.object({
19
- successfulTokens: zod_1.z.array(zod_1.z.string()),
20
- invalidTokens: zod_1.z.array(zod_1.z.string()),
21
- rateLimitedTokens: zod_1.z.array(zod_1.z.string()),
22
- }),
23
- });
@@ -1,39 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const createSimpleStringSchema: ({ max, noSpaces, }?: {
3
- max?: number;
4
- noSpaces?: boolean;
5
- }) => z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
6
- export declare const secureUrlSchema: z.ZodString;
7
- export declare const frameNameSchema: z.ZodString;
8
- export declare const buttonTitleSchema: z.ZodString;
9
- export declare const caip19TokenSchema: z.ZodString;
10
- export declare const hexColorSchema: z.ZodString;
11
- export declare const aspectRatioSchema: z.ZodUnion<[z.ZodLiteral<"1:1">, z.ZodLiteral<"3:2">]>;
12
- export declare const encodedJsonFarcasterSignatureSchema: z.ZodObject<{
13
- header: z.ZodString;
14
- payload: z.ZodString;
15
- signature: z.ZodString;
16
- }, "strip", z.ZodTypeAny, {
17
- header: string;
18
- payload: string;
19
- signature: string;
20
- }, {
21
- header: string;
22
- payload: string;
23
- signature: string;
24
- }>;
25
- export type EncodedJsonFarcasterSignatureSchema = z.infer<typeof encodedJsonFarcasterSignatureSchema>;
26
- export declare const jsonFarcasterSignatureHeaderSchema: z.ZodObject<{
27
- fid: z.ZodNumber;
28
- type: z.ZodLiteral<"app_key">;
29
- key: z.ZodString;
30
- }, "strip", z.ZodTypeAny, {
31
- type: "app_key";
32
- fid: number;
33
- key: string;
34
- }, {
35
- type: "app_key";
36
- fid: number;
37
- key: string;
38
- }>;
39
- export type JsonFarcasterSignatureHeaderSchema = z.infer<typeof jsonFarcasterSignatureHeaderSchema>;
@@ -1,58 +0,0 @@
1
- "use strict";
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;
4
- const zod_1 = require("zod");
5
- const SPECIAL_CHARS_PATTERN = /[@#$%^&*+=\/\\|~«»]/;
6
- const REPEATED_PUNCTUATION_PATTERN = /(!{2,}|\?{2,}|-{2,})/;
7
- // Unicode ranges for emoji detection:
8
- // \u{1F300}-\u{1F9FF} - Miscellaneous Symbols, Pictographs, Emoticons, Transport, Map, and Supplemental
9
- // \u{2702}-\u{27B0} - Dingbats
10
- // \u{2600}-\u{26FF} - Miscellaneous Symbols
11
- // \u{2B00}-\u{2BFF} - Miscellaneous Symbols and Arrows
12
- const EMOJI_PATTERN = /[\u{1F300}-\u{1F9FF}]|[\u{2702}-\u{27B0}]|[\u{2600}-\u{26FF}]|[\u{2B00}-\u{2BFF}]/u;
13
- const createSimpleStringSchema = ({ max, noSpaces, } = {}) => {
14
- const stringValidations = noSpaces
15
- ? zod_1.z
16
- .string()
17
- .max(max ?? Number.POSITIVE_INFINITY)
18
- .regex(/^\S*$/, 'Spaces are not allowed')
19
- : zod_1.z.string().max(max ?? Number.POSITIVE_INFINITY);
20
- return stringValidations
21
- .refine((value) => !EMOJI_PATTERN.test(value), {
22
- message: 'Emojis and symbols are not allowed',
23
- })
24
- .refine((value) => !SPECIAL_CHARS_PATTERN.test(value), {
25
- message: 'Special characters (@, #, $, %, ^, &, *, +, =, /, \\, |, ~, «, ») are not allowed',
26
- })
27
- .refine((value) => !REPEATED_PUNCTUATION_PATTERN.test(value), {
28
- message: 'Repeated punctuations (!!, ??, --) are not allowed',
29
- });
30
- };
31
- exports.createSimpleStringSchema = createSimpleStringSchema;
32
- exports.secureUrlSchema = zod_1.z
33
- .string()
34
- .url()
35
- .startsWith('https://', { message: 'Must be an https url' })
36
- .max(1024);
37
- exports.frameNameSchema = zod_1.z.string().max(32);
38
- exports.buttonTitleSchema = zod_1.z.string().max(32);
39
- const CAIP_19_REGEX = /^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\/(?:[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}(?:\/[-.%a-zA-Z0-9]{1,78})?|native)$/;
40
- exports.caip19TokenSchema = zod_1.z
41
- .string()
42
- .regex(CAIP_19_REGEX, { message: 'Invalid CAIP-19 asset ID' });
43
- exports.hexColorSchema = zod_1.z
44
- .string()
45
- .regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i, {
46
- message: 'Invalid hex color code. It should be in the format #RRGGBB or #RGB.',
47
- });
48
- exports.aspectRatioSchema = zod_1.z.union([zod_1.z.literal('1:1'), zod_1.z.literal('3:2')]);
49
- exports.encodedJsonFarcasterSignatureSchema = zod_1.z.object({
50
- header: zod_1.z.string(),
51
- payload: zod_1.z.string(),
52
- signature: zod_1.z.string(),
53
- });
54
- exports.jsonFarcasterSignatureHeaderSchema = zod_1.z.object({
55
- fid: zod_1.z.number(),
56
- type: zod_1.z.literal('app_key'),
57
- key: zod_1.z.string().startsWith('0x'),
58
- });