@farcaster/snap 1.2.2 → 1.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.
package/dist/schemas.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import { z } from "zod/v4";
2
2
  declare const buttonSchema: z.ZodObject<{
3
3
  label: z.ZodString;
4
4
  action: z.ZodEnum<{
package/dist/schemas.js CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import { z } from "zod/v4";
2
2
  import { BAR_CHART_COLOR_VALUES, BUTTON_ACTION, BUTTON_ACTION_VALUES, BUTTON_GROUP_STYLE, BUTTON_GROUP_STYLE_VALUES, BUTTON_LAYOUT_VALUES, BUTTON_STYLE_VALUES, DEFAULT_BUTTON_LAYOUT, DEFAULT_LIST_STYLE, DEFAULT_SLIDER_STEP, DEFAULT_THEME_ACCENT, EFFECT_VALUES, ELEMENT_TYPE, GRID_CELL_SIZE_VALUES, GRID_GAP_VALUES, GROUP_LAYOUT_VALUES, HEX_COLOR_6_RE, HTTP_PREFIX, HTTPS_PREFIX, IMAGE_ASPECT_VALUES, INTERACTIVE_ELEMENT_TYPES, LIMITS, LIST_STYLE_VALUES, MEDIA_ELEMENT_TYPES, PAGE_ROOT_TYPE, PALETTE_COLOR_VALUES, PROGRESS_COLOR_VALUES, SLIDER_STEP_ALIGN_EPS, SPACER_SIZE, SPACER_SIZE_VALUES, SPEC_VERSION, TEXT_ALIGN_VALUES, TEXT_CONTENT_MAX, TEXT_STYLE, TEXT_STYLE_VALUES, VIDEO_ASPECT_VALUES, } from "./constants.js";
3
3
  /**
4
4
  * post/link/mini_app targets must be HTTPS in production; allow HTTP only for
@@ -1,5 +1,5 @@
1
1
  import { type SnapAction } from "../schemas.js";
2
- import { z } from "zod";
2
+ import { z } from "zod/v4";
3
3
  export type ParseRequestError = {
4
4
  type: "method_not_allowed";
5
5
  message: string;
@@ -1,6 +1,6 @@
1
1
  import { payloadSchema } from "../schemas.js";
2
2
  import { decodePayload, verifyJFSRequestBody } from "./verify.js";
3
- import { z } from "zod";
3
+ import { z } from "zod/v4";
4
4
  /** Default replay window per SPEC.md § Replay Protection (5 minutes). */
5
5
  const DEFAULT_SNAP_POST_MAX_SKEW_SECONDS = 300;
6
6
  const requestBodySchema = z.object({
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import { z } from "zod/v4";
2
2
  export type ValidationResult = {
3
3
  valid: boolean;
4
4
  issues: z.core.$ZodIssue[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farcaster/snap",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "Farcaster Snaps 🫰",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,15 +32,18 @@
32
32
  "license": "MIT",
33
33
  "dependencies": {
34
34
  "@farcaster/jfs": "^0.3.0",
35
- "viem": "^2.21.0",
36
- "zod": "^4.3.6"
35
+ "viem": "^2.21.0"
36
+ },
37
+ "peerDependencies": {
38
+ "zod": "^3.25.0 || ^4.0.0"
37
39
  },
38
40
  "devDependencies": {
39
41
  "@types/node": "^25.5.0",
40
42
  "tsc-alias": "^1.8.16",
41
43
  "tsx": "^4.0.0",
42
44
  "typescript": "^5.4.0",
43
- "vitest": "^1.6.0"
45
+ "vitest": "^1.6.0",
46
+ "zod": "^4.0.0"
44
47
  },
45
48
  "scripts": {
46
49
  "build": "tsc && tsc-alias --resolve-full-paths --resolve-full-extension .js",
package/src/schemas.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import { z } from "zod/v4";
2
2
  import {
3
3
  BAR_CHART_COLOR_VALUES,
4
4
  BUTTON_ACTION,
@@ -1,6 +1,6 @@
1
1
  import { payloadSchema, type SnapAction } from "../schemas";
2
2
  import { decodePayload, verifyJFSRequestBody } from "./verify";
3
- import { z } from "zod";
3
+ import { z } from "zod/v4";
4
4
 
5
5
  /** Default replay window per SPEC.md § Replay Protection (5 minutes). */
6
6
  const DEFAULT_SNAP_POST_MAX_SKEW_SECONDS = 300 as const;
package/src/validator.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import { z } from "zod/v4";
2
2
  import {
3
3
  BUTTON_GROUP_STYLE,
4
4
  DEFAULT_BUTTON_LAYOUT,