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: support for cast action postUrl property #494

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/tiny-carrots-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"frames.js": patch
---

feat: support for cast action postUrl property
2 changes: 2 additions & 0 deletions packages/frames.js/src/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ export type CastActionResponse = {
/** The action type. (Same type options as frame buttons). Only post is accepted in V1. */
action: {
type: "post";
/** Optional action handler URL. If not provided, clients will POST to the same URL as the action metadata route. */
postUrl?: string;
michalkvasnicak marked this conversation as resolved.
Show resolved Hide resolved
};
};

Expand Down
2 changes: 1 addition & 1 deletion packages/render/src/use-fetch-frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ export function useFetchFrame<
const frameButton: FrameButtonPost = {
action: "post",
label: request.action.name,
target: request.action.url,
target: request.action.action.postUrl || request.action.url,
};
const signerStateActionContext: SignerStateDefaultActionContext<
TSignerStorageType,
Expand Down
Loading