@@ -26,6 +26,9 @@ export const App: React.FunctionComponent<IAppProps> = ({ }: React.PropsWithChil
2626 const [ isError , setIsError ] = useState < boolean > ( false ) ;
2727 const [ response , setResponse ] = useState < string > ( "" ) ;
2828
29+ const [ buildPath , setBuildPath ] = useState < string > ( "" ) ;
30+ const [ publishPath , setPublishPath ] = useState < string > ( "" ) ;
31+
2932 let keypair : Ed25519Keypair | null = null ;
3033
3134 const handleNetworkChange = ( e : React . ChangeEvent < HTMLSelectElement > ) => {
@@ -115,11 +118,11 @@ export const App: React.FunctionComponent<IAppProps> = ({ }: React.PropsWithChil
115118 useEffect ( ( ) => {
116119 getDetailPackage ( suiClient , "0xcab68c8cd7e80f3dd06466da6b2c083d1fd50ab3e9be8e32395c19b53021c064" ) . then ( ( data ) => {
117120 const modules = Object . keys ( data as { } ) ;
118-
121+
119122 if ( data ) {
120123 for ( const module of modules ) {
121124 const { exposedFunctions } = data [ module ] ;
122- console . log ( exposedFunctions ) ;
125+
123126 }
124127 }
125128 } ) . catch ( err => console . log ( err ) ) ;
@@ -129,15 +132,40 @@ export const App: React.FunctionComponent<IAppProps> = ({ }: React.PropsWithChil
129132 < >
130133 < h1 > Sui Simulator</ h1 >
131134 < hr />
135+ < h2 > Network</ h2 >
132136 < select value = { network } onChange = { handleNetworkChange } >
133137 < option > devnet</ option >
134138 < option > testnet</ option >
135139 </ select >
136140 < hr />
137- < Input placeholder = "Mnemonics" value = { mnemonics } onChange = { handleMnemonicsChange } />
138- < Input placeholder = "Package ID" value = { packageId } onChange = { ( e ) => setPackageId ( e . target . value ) } />
139- < Input placeholder = "Module" value = { module } onChange = { ( e ) => setModule ( e . target . value ) } />
140- < Input placeholder = "Function Name" value = { functionName } onChange = { ( e ) => setFunctionName ( e . target . value ) } />
141+ < h2 > Buikd</ h2 >
142+ < Input placeholder = "Path" value = { buildPath } onChange = { ( e ) => setBuildPath ( e . target . value ) } />
143+ < Button onClick = { ( ) => { sendMessage ( "BUILD" , { path : buildPath } ) ; } } >
144+ Build
145+ </ Button >
146+ < h2 > Publish</ h2 >
147+ < Input placeholder = "Path" value = { publishPath } onChange = { ( e ) => setPublishPath ( e . target . value ) } />
148+ < Button onClick = { ( ) => { sendMessage ( "PUBLISH" , { path : publishPath } ) ; } } >
149+ Publish
150+ </ Button >
151+ < hr />
152+ < h2 > Call</ h2 >
153+ < div >
154+ < span > Mnemonics: </ span >
155+ < Input placeholder = "Mnemonics" value = { mnemonics } onChange = { handleMnemonicsChange } />
156+ </ div >
157+ < div >
158+ < span > Package: </ span >
159+ < Input placeholder = "Package ID" value = { packageId } onChange = { ( e ) => setPackageId ( e . target . value ) } />
160+ </ div >
161+ < div >
162+ < span > Module: </ span >
163+ < Input placeholder = "Module" value = { module } onChange = { ( e ) => setModule ( e . target . value ) } />
164+ </ div >
165+ < div >
166+ < span > Function: </ span >
167+ < Input placeholder = "Function Name" value = { functionName } onChange = { ( e ) => setFunctionName ( e . target . value ) } />
168+ </ div >
141169 < p > Args</ p >
142170 { args . map ( ( arg , index ) => {
143171 return < > < input type = "text" value = { arg . value } onChange = { ( e ) => {
@@ -163,11 +191,9 @@ export const App: React.FunctionComponent<IAppProps> = ({ }: React.PropsWithChil
163191 } } >
164192 Call
165193 </ Button >
166- < Button onClick = { ( ) => { sendMessage ( "SUI_TERMINAL" , { command : "sui client objects" } ) ; } } >
167- Test Terminal
168- </ Button >
169194 { ! isError ? < p > Result: { response } </ p > : < p > Error: { error } </ p > }
170- < Aliases />
195+ < hr />
196+ < Aliases />
171197 </ >
172198 ) ;
173199} ;
0 commit comments