File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " simplest-frame" ,
33 "type" : " module" ,
4- "version" : " 0.9.1 " ,
4+ "version" : " 0.10.0 " ,
55 "dependencies" : {
66 "@netlify/blobs" : " ^6.4.2" ,
77 "dompurify" : " ^3.0.8" ,
Original file line number Diff line number Diff line change 11import poster from "./poster.js" ;
22import count from "./count.js" ;
33import credits from "./credits.js" ;
4+ import mint from "./mint.js" ;
45import stolen from "./stolen.js" ;
56
67export default {
78 count,
89 poster,
910 credits,
11+ mint,
1012 stolen,
1113}
Original file line number Diff line number Diff line change 1+ import { FrameActionDataParsed } from 'frames.js' ;
2+ import { getTokenUrl } from 'frames.js' ;
3+ import { zora } from 'viem/chains' ;
4+
5+ export default {
6+ name : 'mint' ,
7+ render : async ( ) => {
8+ return {
9+ image : `${ process . env . URL } /images/poster-animated.gif` ,
10+ buttons : [
11+ {
12+ action : 'post' ,
13+ label : '⬅️ Back'
14+ } ,
15+ {
16+ action : 'mint' ,
17+ label : 'Mint' ,
18+ target : getTokenUrl ( {
19+ address : '0xc6d4848c9f01d649dfba170c65a964940a93dca5' ,
20+ chain : zora ,
21+ tokenId : '1' ,
22+ } )
23+ } ,
24+ {
25+ action : 'post' ,
26+ label : '🎬 View credits'
27+ }
28+ ]
29+ }
30+ } ,
31+ handleInteraction : async ( msg : FrameActionDataParsed ) => {
32+ switch ( msg . buttonIndex ) {
33+ case 1 :
34+ return `poster` ;
35+ case 3 :
36+ return `credits` ;
37+ }
38+ } ,
39+ }
Original file line number Diff line number Diff line change @@ -8,19 +8,25 @@ export default {
88 buttons : [
99 {
1010 action : 'post' ,
11- label : '🔳 Try Demo'
11+ label : '🔳 State Demo'
12+ } ,
13+ {
14+ action : 'post' ,
15+ label : '🔳 Mint Demo'
1216 } ,
1317 {
1418 action : 'link' ,
1519 target : 'https://github.com/depatchedmode/simplest-frame' ,
16- label : '{😺} View on Github'
20+ label : 'Github'
1721 }
1822 ]
1923 }
2024 } ,
21- handleInteraction : ( message : FrameActionDataParsed ) => {
22- if ( message . buttonIndex == 1 ) {
25+ handleInteraction : ( msg : FrameActionDataParsed ) => {
26+ if ( msg . buttonIndex == 1 ) {
2327 return `count`
28+ } else if ( msg . buttonIndex == 2 ) {
29+ return `mint`
2430 }
2531 } ,
2632} ;
You can’t perform that action at this time.
0 commit comments