Content
@
0 reply
0 recast
0 reaction
0xSpencer
@0xspencer
Does 'deriveState' exist for multi-step cast actions like it does for raw frames? Essentially trying to figure out how to pass state from the initial Cast Action endpoint to the frame response it returns, but it doesn't seem like I can call deriveState to set it in the initial Action endpoint. cc @jxom @dalechyn.eth
3 replies
0 recast
0 reaction
Vladyslav Dalechyn
@dalechyn.eth
yes, cast actions don't support state so you have to pass the data in the path params: `/my-frame/:data1/:data2` and parse one by-one or `/my-frame/:data/` and JSON.parse it.
1 reply
0 recast
1 reaction
0xSpencer
@0xspencer
cool that's the work around solution i've been doing, but was curious if i was missing something obvious. thanks for the quick response! 300 $degen
5 replies
0 recast
1 reaction
Jilt 🎩
@jilt
I'm sure the button values and the status is passed through c at least for one step, c.var should persist but I'm not happy with the hono middleware by now, in express.js was waaaaay easier to attach to endpoints, will let you know soon!
0 reply
0 recast
1 reaction
Vladyslav Dalechyn
@dalechyn.eth
yess that's a bit annoying, mentioned it here https://warpcast.com/dalechyn.eth/0xa1d8ec0e. still wondering if there's a better (and typed) way to pass such.
0 reply
0 recast
1 reaction
Jilt 🎩
@jilt
I have the answer but I don't know how to format the code here: // Fam check middleware app.use('/check/*', async (c, next) => { c.set('fam', true) await next() }) app.frame('/check', async (c) => { const { buttonValue, inputText } = c const fam = c.var.fam console.log(fam) return c.res({ image: ( <Box> <Heading> Just checking! </Heading> <Text>{fam ? `You're FAM!` : 'This Fam is token gated'}</Text> </Box> ), intents: [ <TextInput placeholder="Ask your question..." />, fam == true && <Button value="submit">Submit</Button>, ], }) });
0 reply
0 recast
0 reaction
Jilt 🎩
@jilt
Omg, I just made it!!!
0 reply
0 recast
0 reaction