@@ -16,7 +16,7 @@ import type { PreparedTransaction } from "../../../transaction/prepare-transacti
1616import type { TransactionReceipt } from "../../../transaction/types.js" ;
1717import { encodeAbiParameters } from "../../../utils/abi/encodeAbiParameters.js" ;
1818import { isContractDeployed } from "../../../utils/bytecode/is-contract-deployed.js" ;
19- import type { Hex } from "../../../utils/encoding/hex.js" ;
19+ import { type Hex , toHex } from "../../../utils/encoding/hex.js" ;
2020import { hexToBytes } from "../../../utils/encoding/to-bytes.js" ;
2121import { isThirdwebUrl } from "../../../utils/fetch.js" ;
2222import { resolvePromisedValue } from "../../../utils/promise/resolve-promised-value.js" ;
@@ -662,7 +662,7 @@ async function getAccountNonce(options: {
662662 if ( getNonceOverride ) {
663663 return getNonceOverride ( accountContract ) ;
664664 }
665- return getNonce ( {
665+ const nonce = await getNonce ( {
666666 contract : getContract ( {
667667 address : entrypointAddress || ENTRYPOINT_ADDRESS_v0_6 ,
668668 chain,
@@ -671,6 +671,11 @@ async function getAccountNonce(options: {
671671 key : generateRandomUint192 ( ) ,
672672 sender : accountContract . address ,
673673 } ) ;
674+ // FIXME - only for modular accounts to pass validator in
675+ const withValidator = `0x${ "0" . repeat ( 40 ) } ${ toHex ( nonce ) . slice ( 42 ) } ` ;
676+ console . log ( "withValidator" , withValidator ) ;
677+ console . log ( "withValidator" , withValidator . length ) ;
678+ return withValidator ;
674679}
675680
676681/**
@@ -680,6 +685,7 @@ async function getAccountNonce(options: {
680685 * @example
681686 * ```ts
682687 * import { createAndSignUserOp } from "thirdweb/wallets/smart";
688+ import { keccak256 } from "../../../utils/hashing/keccak256.js";
683689 *
684690 * const userOp = await createAndSignUserOp({
685691 * client,
0 commit comments