@@ -14,7 +14,7 @@ import { toSerializableTransaction } from "../../../transaction/actions/to-seria
1414import type { PreparedTransaction } from "../../../transaction/prepare-transaction.js" ;
1515import type { TransactionReceipt } from "../../../transaction/types.js" ;
1616import { isContractDeployed } from "../../../utils/bytecode/is-contract-deployed.js" ;
17- import type { Hex } from "../../../utils/encoding/hex.js" ;
17+ import { type Hex , toHex } from "../../../utils/encoding/hex.js" ;
1818import { hexToBytes } from "../../../utils/encoding/to-bytes.js" ;
1919import { isThirdwebUrl } from "../../../utils/fetch.js" ;
2020import { resolvePromisedValue } from "../../../utils/promise/resolve-promised-value.js" ;
@@ -639,7 +639,7 @@ async function getAccountNonce(options: {
639639 if ( getNonceOverride ) {
640640 return getNonceOverride ( accountContract ) ;
641641 }
642- return getNonce ( {
642+ const nonce = await getNonce ( {
643643 contract : getContract ( {
644644 address : entrypointAddress || ENTRYPOINT_ADDRESS_v0_6 ,
645645 chain,
@@ -648,6 +648,11 @@ async function getAccountNonce(options: {
648648 key : generateRandomUint192 ( ) ,
649649 sender : accountContract . address ,
650650 } ) ;
651+ // FIXME - only for modular accounts to pass validator in
652+ const withValidator = `0x${ "0" . repeat ( 40 ) } ${ toHex ( nonce ) . slice ( 42 ) } ` ;
653+ console . log ( "withValidator" , withValidator ) ;
654+ console . log ( "withValidator" , withValidator . length ) ;
655+ return withValidator ;
651656}
652657
653658/**
@@ -657,6 +662,7 @@ async function getAccountNonce(options: {
657662 * @example
658663 * ```ts
659664 * import { createAndSignUserOp } from "thirdweb/wallets/smart";
665+ import { keccak256 } from "../../../utils/hashing/keccak256.js";
660666 *
661667 * const userOp = await createAndSignUserOp({
662668 * client,
0 commit comments