Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: frames v2 support #531

Merged
merged 88 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
526a898
chore: frames v2 test app template
michalkvasnicak Nov 26, 2024
fb055d2
fix: cast action message response definition
michalkvasnicak Nov 27, 2024
bd19f00
feat: basic frames v2 parsing
michalkvasnicak Nov 27, 2024
53ca37d
fix: do not cause infinite render cycle when using initialPendingExtra
michalkvasnicak Nov 28, 2024
521d26c
feat: basic frames v2 support
michalkvasnicak Nov 28, 2024
e2960ff
fix: properly type current frame stack item
michalkvasnicak Nov 28, 2024
bc429a1
refactor: types
michalkvasnicak Nov 28, 2024
1ef4387
feat: useCastAction hook and fixing issues with signer copy
michalkvasnicak Nov 28, 2024
842b0fd
refactor: use new cast action hook and unstable frame hooks in debugger
michalkvasnicak Nov 28, 2024
a6188b8
feat: export signer instance types
michalkvasnicak Nov 28, 2024
522e33e
chore: add farcaster v2 to protocol selector
michalkvasnicak Nov 28, 2024
502f8b8
fix: make frame v2 parsing compatible with spec
michalkvasnicak Nov 28, 2024
9acc960
fix: parsing frame button
michalkvasnicak Nov 28, 2024
92fbd7f
feat: allow multi spec signer
michalkvasnicak Nov 28, 2024
ceee7bb
feat: allow debugger to lock specification
michalkvasnicak Nov 28, 2024
3f5f543
fix: launch button type
michalkvasnicak Nov 28, 2024
b2ee51d
chore: define handler for frame launching
michalkvasnicak Nov 28, 2024
a1504c0
feat: add new hook to handle frames v2 app
michalkvasnicak Nov 29, 2024
4380126
feat: add app frame dialog
michalkvasnicak Nov 29, 2024
63ba230
chore: basic frames 2 example
michalkvasnicak Nov 29, 2024
aa8b571
fix: test
michalkvasnicak Nov 29, 2024
3102c93
test: add farcaster v2 tests
michalkvasnicak Nov 29, 2024
060b8b4
chore: update sdk
michalkvasnicak Dec 2, 2024
344fc74
fix: unregister exposed comlink listeners
michalkvasnicak Dec 2, 2024
627c889
chore: unregister all exposed listeners
michalkvasnicak Dec 3, 2024
4de02fa
feat: add helpers to detect fully valid frames
michalkvasnicak Dec 3, 2024
f158920
chore: split parse result types
michalkvasnicak Dec 3, 2024
6027ac8
feat: add json farcaster signature utils
michalkvasnicak Dec 3, 2024
792db1a
fix: make json signatures browser compatible
michalkvasnicak Dec 4, 2024
be4a226
feat: add domain account association generator to debugger
michalkvasnicak Dec 4, 2024
e0ddb6d
chore: add comments
michalkvasnicak Dec 4, 2024
e51b0b4
test: signature signing
michalkvasnicak Dec 4, 2024
b2077c5
chore: eslint fix
michalkvasnicak Dec 4, 2024
4d7d825
feat: parse and validate farcaster v2 frames and manifest
michalkvasnicak Dec 4, 2024
42d348e
fix: make route handlers compatible with async parsing
michalkvasnicak Dec 4, 2024
f35b269
fix: use 3:2 aspect ratio for frame
michalkvasnicak Dec 5, 2024
c198e8b
feat: support react native
michalkvasnicak Dec 5, 2024
fdff970
chore: remove our starter
michalkvasnicak Dec 5, 2024
86dcd42
fix: add missing parse result
michalkvasnicak Dec 5, 2024
1967d20
feat: show fc v1/v2 alert
michalkvasnicak Dec 5, 2024
20d0d2e
feat: manifest debugger tab
michalkvasnicak Dec 5, 2024
1babf37
chore: update peer dep and properly handle events
michalkvasnicak Dec 6, 2024
b4ca923
chore: enable debug mode
michalkvasnicak Dec 6, 2024
7ec5cac
fix: throw an error because the error message is not the same as sdk …
michalkvasnicak Dec 6, 2024
bb96c9a
feat: allow to hook into tx, messages and typed data signing
michalkvasnicak Dec 9, 2024
37e92a6
feat: add an option to enable manifest parsing
michalkvasnicak Dec 9, 2024
12c61e3
fix: wait for wallet client
michalkvasnicak Dec 10, 2024
e3e81af
feat: allow to use different connectors
michalkvasnicak Dec 11, 2024
05fb8c2
chore: use new provider in debugger
michalkvasnicak Dec 11, 2024
1196efc
feat: fetch frame in useFrameApp hook
michalkvasnicak Dec 11, 2024
eaeafe4
fix: peer dep
michalkvasnicak Dec 11, 2024
36e5d12
chore: return props as object
michalkvasnicak Dec 11, 2024
e797580
fix: use iframeProps
michalkvasnicak Dec 11, 2024
c58f502
fix: eslint issue
michalkvasnicak Dec 11, 2024
b142825
chore: export return and option types
michalkvasnicak Dec 12, 2024
a3f9787
fix: check if emitter is really set
michalkvasnicak Dec 12, 2024
044734a
chore: update peer deps
michalkvasnicak Dec 12, 2024
8c179ae
fix: frame app dialog layout
michalkvasnicak Dec 13, 2024
46fff8a
chore: remove unnecessary handler
michalkvasnicak Dec 13, 2024
c8bb17a
chore: allow to debug eth provider requests
michalkvasnicak Dec 13, 2024
45bd669
feat: allow to launch app in different contexts
michalkvasnicak Dec 13, 2024
dab237b
fix: respect abort signal
michalkvasnicak Dec 13, 2024
13faad2
feat: allow to resolve client
michalkvasnicak Dec 13, 2024
f8593fb
feat: simple notifications support
michalkvasnicak Dec 13, 2024
d3b0016
chore: do not allow to run frame app debugger from cast action debugger
michalkvasnicak Dec 14, 2024
5b8085e
feat: allow to manage frame and notification settings
michalkvasnicak Dec 17, 2024
8eb885e
feat: notifications event log and webhooks
michalkvasnicak Dec 18, 2024
cfae040
chore: use bigger ttl
michalkvasnicak Dec 18, 2024
e4f0a05
chore: add cli options for kv store
michalkvasnicak Dec 18, 2024
e723d30
chore: integrate farcaster implementation of frames v2
michalkvasnicak Dec 19, 2024
02bc315
feat: emit events
michalkvasnicak Dec 19, 2024
f7c098c
chore: rename variables
michalkvasnicak Dec 19, 2024
08f8ca7
fix: compilation error
michalkvasnicak Dec 19, 2024
e1c6a8c
fix: import as type
michalkvasnicak Dec 19, 2024
1706b7c
chore: emit events
michalkvasnicak Dec 19, 2024
10cf966
fix: do not reload frame app on notifications state changes
michalkvasnicak Dec 19, 2024
1fccc06
chore: do not store signer key
michalkvasnicak Dec 19, 2024
f01485c
feat: use sqlite if redis is not available
michalkvasnicak Dec 20, 2024
25c6e04
feat: allow non strict parsing
michalkvasnicak Dec 20, 2024
f9306b0
chore: changeset
michalkvasnicak Dec 20, 2024
47ed743
chore: remove package that doesn't exist
michalkvasnicak Dec 20, 2024
a0c254a
chore: bump facaster/core and protobuf
michalkvasnicak Dec 20, 2024
d433d3f
chore: allow non https urls in debugger notifications endpoints
michalkvasnicak Dec 20, 2024
dd1b307
chore: make sqlite optional dep
michalkvasnicak Dec 20, 2024
cdbed94
fix: event log scrolling
michalkvasnicak Dec 20, 2024
688d7a6
chore: add alert on unsupported signer state
michalkvasnicak Dec 20, 2024
70f349d
chore: allow impersonated signers
michalkvasnicak Dec 20, 2024
3b19aa7
fix: correcly show notifications panel
michalkvasnicak Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/ninety-ducks-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"frames.js": minor
"@frames.js/debugger": minor
"@frames.js/render": minor
---

feat: farcaster v2 support
6 changes: 5 additions & 1 deletion packages/debugger/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ FARCASTER_DEVELOPER_MNEMONIC=
# Example: FARCASTER_DEVELOPER_FID=1214
FARCASTER_DEVELOPER_FID=

NEXT_PUBLIC_WALLETCONNECT_ID=
NEXT_PUBLIC_WALLETCONNECT_ID=

# Required to debug Farcaster Frames v2 notifications
KV_REST_API_TOKEN=""
KV_REST_API_URL=""
3 changes: 2 additions & 1 deletion packages/debugger/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
mocks.json
mocks.json
/notifications.db
120 changes: 120 additions & 0 deletions packages/debugger/app/components/action-debugger-properties-table.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import { useMemo } from "react";
import type { CastActionDefinitionResponse } from "../frames/route";
import type { ParsingReport } from "frames.js";
import { Table, TableBody, TableCell, TableRow } from "@/components/table";
import { AlertTriangleIcon, CheckCircle2Icon, XCircleIcon } from "lucide-react";
import { cn } from "@/lib/utils";
import { ShortenedText } from "./shortened-text";

function isPropertyExperimental([key, value]: [string, string]) {
return false;
}

type ActionDebuggerPropertiesTableProps = {
actionMetadataItem: CastActionDefinitionResponse;
};

export function ActionDebuggerPropertiesTable({
actionMetadataItem,
}: ActionDebuggerPropertiesTableProps) {
const properties = useMemo(() => {
/** tuple of key and value */
const validProperties: [string, string][] = [];
/** tuple of key and error message */
const invalidProperties: [string, ParsingReport[]][] = [];
const visitedInvalidProperties: string[] = [];
const result = actionMetadataItem;

// we need to check validation errors first because getFrame incorrectly return a value for a key even if it's invalid
for (const [key, reports] of Object.entries(result.reports)) {
invalidProperties.push([key, reports]);
visitedInvalidProperties.push(key);
}

for (const [key, value] of Object.entries(result.action)) {
if (visitedInvalidProperties.includes(key) || value == null) {
continue;
}

if (typeof value === "object") {
validProperties.push([key, JSON.stringify(value)]);
} else {
validProperties.push([key, value]);
}
}

return {
validProperties,
invalidProperties,
isValid: invalidProperties.length === 0,
hasExperimentalProperties: false,
};
}, [actionMetadataItem]);

return (
<Table>
<TableBody>
{properties.validProperties.map(([propertyKey, value]) => {
return (
<TableRow key={`${propertyKey}-valid`}>
<TableCell>
{isPropertyExperimental([propertyKey, value]) ? (
<span className="whitespace-nowrap flex">
<div className="inline">
<CheckCircle2Icon size={20} color="orange" />
</div>
<div className="inline text-slate-500">*</div>
</span>
) : (
<CheckCircle2Icon size={20} color="green" />
)}
</TableCell>
<TableCell>{propertyKey}</TableCell>
<TableCell className="text-slate-500">
<ShortenedText text={value} maxLength={30} />
</TableCell>
</TableRow>
);
})}
{properties.invalidProperties.flatMap(
([propertyKey, errorMessages]) => {
return errorMessages.map((errorMessage, i) => {
return (
<TableRow key={`${propertyKey}-${i}-invalid`}>
<TableCell>
{errorMessage.level === "error" ? (
<XCircleIcon size={20} color="red" />
) : (
<AlertTriangleIcon size={20} color="orange" />
)}
</TableCell>
<TableCell>{propertyKey}</TableCell>
<TableCell className="text-slate-500">
<p
className={cn(
"font-bold",
errorMessage.level === "error"
? "text-red-500"
: "text-orange-500"
)}
>
{errorMessage.message}
</p>
</TableCell>
</TableRow>
);
});
}
)}
{properties.hasExperimentalProperties && (
<TableRow>
<TableCell colSpan={3} className="text-slate-500">
*This property is experimental and may not have been adopted in
clients yet
</TableCell>
</TableRow>
)}
</TableBody>
</Table>
);
}
Loading
Loading