@@ -12,6 +12,9 @@ import {
1212 type SignFeeIntentDAError ,
1313 type SignFeeIntentDAIntermediateValue ,
1414 type SignFeeIntentDAOutput ,
15+ type SignNestedCallDAError ,
16+ type SignNestedCallDAIntermediateValue ,
17+ type SignNestedCallDAOutput ,
1518 type SignRootIntentDAError ,
1619 type SignRootIntentDAIntermediateValue ,
1720 type SignRootIntentDAOutput ,
@@ -69,7 +72,7 @@ export const SignerAleoView: React.FC<{ sessionId: string }> = ({
6972 } ) ;
7073 } ,
7174 initialValues : {
72- derivationPath : "44'/683'/0" ,
75+ derivationPath : "44'/683'/0'/0' " ,
7376 checkOnDevice : false ,
7477 skipOpenApp : false ,
7578 } ,
@@ -134,7 +137,7 @@ export const SignerAleoView: React.FC<{ sessionId: string }> = ({
134137 } ) ;
135138 } ,
136139 initialValues : {
137- derivationPath : "44'/683'/0" ,
140+ derivationPath : "44'/683'/0'/0' " ,
138141 rootIntent : "" ,
139142 skipOpenApp : false ,
140143 } ,
@@ -186,6 +189,44 @@ export const SignerAleoView: React.FC<{ sessionId: string }> = ({
186189 SignFeeIntentDAError ,
187190 SignFeeIntentDAIntermediateValue
188191 > ,
192+ {
193+ title : "Sign Nested Call" ,
194+ description : "Sign a nested call with the device" ,
195+ executeDeviceAction : ( { nestedCallRequest, skipOpenApp } ) => {
196+ if ( ! signer ) {
197+ throw new Error ( "Signer not initialized" ) ;
198+ }
199+ // Convert hex string to Uint8Array
200+ const nestedCallRequestBytes = nestedCallRequest . startsWith ( "0x" )
201+ ? new Uint8Array (
202+ nestedCallRequest
203+ . slice ( 2 )
204+ . match ( / .{ 1 , 2 } / g)
205+ ?. map ( ( byte ) => Number . parseInt ( byte , 16 ) ) ?? [ ] ,
206+ )
207+ : new Uint8Array (
208+ nestedCallRequest
209+ . match ( / .{ 1 , 2 } / g)
210+ ?. map ( ( byte ) => Number . parseInt ( byte , 16 ) ) ?? [ ] ,
211+ ) ;
212+ return signer . signNestedCall ( nestedCallRequestBytes , {
213+ skipOpenApp,
214+ } ) ;
215+ } ,
216+ initialValues : {
217+ nestedCallRequest : "" ,
218+ skipOpenApp : false ,
219+ } ,
220+ deviceModelId,
221+ } satisfies DeviceActionProps <
222+ SignNestedCallDAOutput ,
223+ {
224+ nestedCallRequest : string ;
225+ skipOpenApp ?: boolean ;
226+ } ,
227+ SignNestedCallDAError ,
228+ SignNestedCallDAIntermediateValue
229+ > ,
189230 ] ,
190231 [ deviceModelId , signer ] ,
191232 ) ;
0 commit comments