Case 3: Raffle events among the filtered casts
guide on how to create the desired frame using frog.fm
Last updated
guide on how to create the desired frame using frog.fm
Last updated
** The full code for this example can be found here. ** You can check the operation of the completed sample here. ** This example demonstrates creating a frame via frog.fm. For more details about frog, please refer to the official documentation below.
This example sequentially takes the following three inputs and randomly selects one of the authors from the filtered casts based on those inputs.
Data Query Using Lum0x SDK
1) The getUserDisplayName
function and the getUserPfpUrl
function are used to retrieve user information through Lum0x.farcasterUser.getUserByFids
2) The part that retrieves the feed is done through Lum0x.farcasterUser.getFeed
Managing input data for each screen as state
1) Set initialState
2) Update state with values entered via TextInput
(using deriveState
, previousState
)
Adding an Image to the Screen and Binding Data 1) Add Image
2) Data Binding
Pass the return value of the getShareImage
function to the image
property of the frame
.
getShareImage
is a function that returns a <BOX/>
element.
4. Add postLum0xTestFrameValidation
By adding this part, the user information of those who pressed the frame will be sent to Lum0x, and later, statistics based on this data will be provided.
Please deploy the completed project code on Vercel. For instructions on how to deploy via Vercel, refer to this guide here.