@farcaster/snap-hono 1.1.7 → 1.1.8
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type SnapResponseInput } from "@farcaster/snap";
|
|
2
2
|
type PayloadToResponseOptions = {
|
|
3
3
|
resourcePath: string;
|
|
4
4
|
mediaTypes: string[];
|
|
5
5
|
};
|
|
6
|
-
export declare function payloadToResponse(payload:
|
|
6
|
+
export declare function payloadToResponse(payload: SnapResponseInput, options?: Partial<PayloadToResponseOptions>): Response;
|
|
7
7
|
export declare function snapHeaders(resourcePath: string, currentMediaType: string, availableMediaTypes: string[]): {
|
|
8
8
|
"Content-Type": string;
|
|
9
9
|
Vary: string;
|
package/dist/renderSnapPage.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function renderSnapPage(snap:
|
|
1
|
+
import type { SnapResponseInput } from "@farcaster/snap";
|
|
2
|
+
export declare function renderSnapPage(snap: SnapResponseInput, snapOrigin: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farcaster/snap-hono",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "Hono integration for Farcaster Snap servers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@farcaster/snap": "1.3.
|
|
29
|
+
"@farcaster/snap": "1.3.3"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"hono": ">=4.0.0"
|
package/src/payloadToResponse.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MEDIA_TYPE,
|
|
3
3
|
rootSchema,
|
|
4
|
-
type
|
|
4
|
+
type SnapResponseInput,
|
|
5
5
|
validatePage,
|
|
6
6
|
} from "@farcaster/snap";
|
|
7
7
|
|
|
@@ -13,7 +13,7 @@ type PayloadToResponseOptions = {
|
|
|
13
13
|
const DEFAULT_LINK_MEDIA_TYPES = [MEDIA_TYPE, "text/html"] as const;
|
|
14
14
|
|
|
15
15
|
export function payloadToResponse(
|
|
16
|
-
payload:
|
|
16
|
+
payload: SnapResponseInput,
|
|
17
17
|
options: Partial<PayloadToResponseOptions> = {},
|
|
18
18
|
): Response {
|
|
19
19
|
const resourcePath = options.resourcePath ?? "/";
|
package/src/renderSnapPage.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SnapResponseInput } from "@farcaster/snap";
|
|
2
2
|
|
|
3
3
|
const PALETTE: Record<string, string> = {
|
|
4
4
|
gray: "#8F8F8F",
|
|
@@ -307,7 +307,7 @@ function renderButtons(
|
|
|
307
307
|
|
|
308
308
|
// ─── Main renderer ──────────────────────────────────────
|
|
309
309
|
|
|
310
|
-
export function renderSnapPage(snap:
|
|
310
|
+
export function renderSnapPage(snap: SnapResponseInput, snapOrigin: string): string {
|
|
311
311
|
const page = snap.page;
|
|
312
312
|
const accent = accentHex(page.theme?.accent);
|
|
313
313
|
|