-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added
generateFrameNextMetadata
to help generates the metadat…
…a for a Farcaster Frame (#12)
- Loading branch information
Showing
6 changed files
with
40 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@coinbase/onchainkit": patch | ||
--- | ||
|
||
**feat**: added `generateFrameNextMetadata` to help generates the metadata for a Farcaster Frame. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* This function generates the metadata for a Farcaster Frame. | ||
* @param param0 | ||
* @returns | ||
*/ | ||
export const generateFrameNextMetadata = function ({ | ||
buttons, | ||
image, | ||
post_url, | ||
}: { | ||
buttons: string[]; | ||
image: string; | ||
post_url: string; | ||
}) { | ||
const metadata: Record<string, string> = { | ||
'fc:frame': 'vNext', | ||
}; | ||
buttons.forEach((button, index) => { | ||
metadata[`fc:frame:button:${index + 1}`] = button; | ||
}); | ||
metadata['fc:frame:image'] = image; | ||
metadata['fc:frame:post_url'] = post_url; | ||
return metadata; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { generateFrameNextMetadata } from './generateFrameNextMetadata'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
// ☕️ | ||
const version = '0.0.0'; | ||
const version = '0.1.1'; | ||
|
||
// TODO remove this line from here | ||
export { generateFrameNextMetadata } from './core/generateFrameNextMetadata'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters