@farcaster/snap-hono 1.5.12 → 2.0.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/fallback.js CHANGED
@@ -36,14 +36,14 @@ ${ogLines.join("\n")}
36
36
  *{margin:0;padding:0;box-sizing:border-box}
37
37
  body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;background:#0A0A0A;color:#FAFAFA;min-height:100vh;display:flex;align-items:center;justify-content:center}
38
38
  .c{text-align:center;max-width:400px;padding:48px 32px}
39
- .logo{color:#8B5CF6;margin-bottom:24px}
39
+ .logo{color:#907AA9;margin-bottom:24px}
40
40
  .logo svg{width:48px;height:42px}
41
41
  h1{font-size:24px;font-weight:700;margin-bottom:8px}
42
42
  p{color:#A1A1AA;font-size:15px;line-height:1.5;margin-bottom:32px}
43
43
  .btns{display:flex;flex-direction:column;gap:12px}
44
44
  a{display:flex;align-items:center;justify-content:center;gap:8px;padding:12px 24px;border-radius:12px;font-size:15px;font-weight:600;text-decoration:none;transition:opacity .15s}
45
45
  a:hover{opacity:.85}
46
- .p{background:#8B5CF6;color:#fff}
46
+ .p{background:#907AA9;color:#fff}
47
47
  .s{background:#1A1A2E;color:#FAFAFA;border:1px solid #2D2D44}
48
48
  .s svg{width:20px;height:18px}
49
49
  </style>
package/dist/index.js CHANGED
@@ -133,6 +133,7 @@ export function registerSnapHandler(app, snapFn, options = {}) {
133
133
  case "origin_mismatch":
134
134
  return c.json({ error: err.message }, 400);
135
135
  case "signature":
136
+ case "fid_mismatch":
136
137
  return c.json({ error: err.message }, 401);
137
138
  default: {
138
139
  const _exhaustive = err;
@@ -215,8 +216,7 @@ function snapOriginFromRequest(request) {
215
216
  }
216
217
  }
217
218
  const url = new URL(request.url);
218
- const proto = request.headers.get("x-forwarded-proto") ??
219
- url.protocol.replace(":", "");
219
+ const proto = request.headers.get("x-forwarded-proto") ?? url.protocol.replace(":", "");
220
220
  const host = request.headers.get("x-forwarded-host") ?? url.host;
221
221
  return `${proto}://${host}`;
222
222
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farcaster/snap-hono",
3
- "version": "1.5.12",
3
+ "version": "2.0.0",
4
4
  "description": "Hono integration for Farcaster Snap servers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "@resvg/resvg-wasm": "^2.6.2",
30
30
  "satori": "^0.10.0",
31
- "@farcaster/snap": "1.22.1"
31
+ "@farcaster/snap": "2.0.0"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "hono": ">=4.0.0"
package/src/fallback.ts CHANGED
@@ -57,14 +57,14 @@ ${ogLines.join("\n")}
57
57
  *{margin:0;padding:0;box-sizing:border-box}
58
58
  body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;background:#0A0A0A;color:#FAFAFA;min-height:100vh;display:flex;align-items:center;justify-content:center}
59
59
  .c{text-align:center;max-width:400px;padding:48px 32px}
60
- .logo{color:#8B5CF6;margin-bottom:24px}
60
+ .logo{color:#907AA9;margin-bottom:24px}
61
61
  .logo svg{width:48px;height:42px}
62
62
  h1{font-size:24px;font-weight:700;margin-bottom:8px}
63
63
  p{color:#A1A1AA;font-size:15px;line-height:1.5;margin-bottom:32px}
64
64
  .btns{display:flex;flex-direction:column;gap:12px}
65
65
  a{display:flex;align-items:center;justify-content:center;gap:8px;padding:12px 24px;border-radius:12px;font-size:15px;font-weight:600;text-decoration:none;transition:opacity .15s}
66
66
  a:hover{opacity:.85}
67
- .p{background:#8B5CF6;color:#fff}
67
+ .p{background:#907AA9;color:#fff}
68
68
  .s{background:#1A1A2E;color:#FAFAFA;border:1px solid #2D2D44}
69
69
  .s svg{width:20px;height:18px}
70
70
  </style>
package/src/index.ts CHANGED
@@ -214,6 +214,7 @@ export function registerSnapHandler(
214
214
  case "origin_mismatch":
215
215
  return c.json({ error: err.message }, 400);
216
216
  case "signature":
217
+ case "fid_mismatch":
217
218
  return c.json({ error: err.message }, 401);
218
219
  default: {
219
220
  const _exhaustive: never = err;
@@ -315,8 +316,7 @@ function snapOriginFromRequest(request: Request): string {
315
316
 
316
317
  const url = new URL(request.url);
317
318
  const proto =
318
- request.headers.get("x-forwarded-proto") ??
319
- url.protocol.replace(":", "");
319
+ request.headers.get("x-forwarded-proto") ?? url.protocol.replace(":", "");
320
320
  const host = request.headers.get("x-forwarded-host") ?? url.host;
321
321
  return `${proto}://${host}`;
322
322
  }