@@ -181,14 +181,15 @@ export function prepareExecute(args: {
181181 if ( execute ) {
182182 return execute ( accountContract , transaction ) ;
183183 }
184+ let value = transaction . value || 0n ;
185+ // special handling of hedera chains, decimals for native value is 8 instead of 18 when passed as contract params
186+ if ( transaction . chainId === 295 || transaction . chainId === 296 ) {
187+ value = value / BigInt ( 10 ** 10 ) ;
188+ }
184189 return prepareContractCall ( {
185190 contract : accountContract ,
186191 method : "function execute(address, uint256, bytes)" ,
187- params : [
188- transaction . to || "" ,
189- transaction . value || 0n ,
190- transaction . data || "0x" ,
191- ] ,
192+ params : [ transaction . to || "" , value , transaction . data || "0x" ] ,
192193 // if gas is specified for the inner tx, use that and add 21k for the execute call on the account contract
193194 // this avoids another estimateGas call when bundling the userOp
194195 // and also allows for passing custom gas limits for the inner tx
@@ -215,12 +216,18 @@ export function prepareBatchExecute(args: {
215216 if ( executeBatch ) {
216217 return executeBatch ( accountContract , transactions ) ;
217218 }
219+ let values = transactions . map ( ( tx ) => tx . value || 0n ) ;
220+ const chainId = transactions [ 0 ] ?. chainId ;
221+ // special handling of hedera chains, decimals for native value is 8 instead of 18 when passed as contract params
222+ if ( chainId === 295 || chainId === 296 ) {
223+ values = values . map ( ( value ) => value / BigInt ( 10 ** 10 ) ) ;
224+ }
218225 return prepareContractCall ( {
219226 contract : accountContract ,
220227 method : "function executeBatch(address[], uint256[], bytes[])" ,
221228 params : [
222229 transactions . map ( ( tx ) => tx . to || "" ) ,
223- transactions . map ( ( tx ) => tx . value || 0n ) ,
230+ values ,
224231 transactions . map ( ( tx ) => tx . data || "0x" ) ,
225232 ] ,
226233 } ) ;
0 commit comments