1- import { AbiParameters , Hex } from "ox" ;
1+ import * as ox__AbiParameters from "ox/AbiParameters" ;
2+ import * as ox__Hex from "ox/Hex" ;
23import { serializeErc6492Signature } from "../../../auth/serialize-erc6492-signature.js" ;
34import { verifyHash } from "../../../auth/verify-hash.js" ;
45import { ZERO_ADDRESS } from "../../../constants/addresses.js" ;
@@ -56,9 +57,9 @@ export type ERC7579Config = SmartWalletOptions & {
5657export function erc7579 ( options : ERC7579Config ) : SmartWalletOptions {
5758 const saltHex =
5859 options . overrides ?. accountSalt &&
59- Hex . validate ( options . overrides . accountSalt )
60+ ox__Hex . validate ( options . overrides . accountSalt )
6061 ? options . overrides . accountSalt
61- : Hex . fromString ( options . overrides ?. accountSalt ?? "" ) ;
62+ : ox__Hex . fromString ( options . overrides ?. accountSalt ?? "" ) ;
6263 const defaultValidator = getAddress ( options . validatorAddress ) ;
6364 const modularAccountOptions : SmartWalletOptions = {
6465 ...options ,
@@ -75,7 +76,7 @@ export function erc7579(options: ERC7579Config): SmartWalletOptions {
7576 {
7677 moduleTypeId : 1n , // validator type id
7778 module : defaultValidator ,
78- initData : Hex . fromString ( "" ) ,
79+ initData : ox__Hex . fromString ( "" ) ,
7980 } ,
8081 ] ;
8182 return {
@@ -99,8 +100,8 @@ export function erc7579(options: ERC7579Config): SmartWalletOptions {
99100 contract : accountContract ,
100101 async asyncParams ( ) {
101102 return {
102- mode : Hex . padRight ( "0x00" , 32 ) , // single execution
103- executionCalldata : AbiParameters . encodePacked (
103+ mode : ox__Hex . padRight ( "0x00" , 32 ) , // single execution
104+ executionCalldata : ox__AbiParameters . encodePacked (
104105 [ "address" , "uint256" , "bytes" ] ,
105106 [
106107 transaction . to || ZERO_ADDRESS ,
@@ -117,8 +118,8 @@ export function erc7579(options: ERC7579Config): SmartWalletOptions {
117118 contract : accountContract ,
118119 async asyncParams ( ) {
119120 return {
120- mode : Hex . padRight ( "0x01" , 32 ) , // batch execution
121- executionCalldata : AbiParameters . encode (
121+ mode : ox__Hex . padRight ( "0x01" , 32 ) , // batch execution
122+ executionCalldata : ox__AbiParameters . encode (
122123 [
123124 {
124125 type : "tuple[]" ,
@@ -152,10 +153,10 @@ export function erc7579(options: ERC7579Config): SmartWalletOptions {
152153 sender : accountContract . address ,
153154 } ) ;
154155 // TODO (msa) - could be different if validator for the deployed account is different
155- const withValidator = Hex . from (
156- `${ defaultValidator } ${ Hex . fromNumber ( entryPointNonce ) . slice ( 42 ) } ` ,
156+ const withValidator = ox__Hex . from (
157+ `${ defaultValidator } ${ ox__Hex . fromNumber ( entryPointNonce ) . slice ( 42 ) } ` ,
157158 ) ;
158- return Hex . toBigInt ( withValidator ) ;
159+ return ox__Hex . toBigInt ( withValidator ) ;
159160 } ,
160161 async signMessage ( options ) {
161162 const { accountContract, factoryContract, adminAccount, message } =
@@ -201,7 +202,7 @@ async function generateSignature(options: {
201202 accountContract : ThirdwebContract ;
202203 factoryContract : ThirdwebContract ;
203204 adminAccount : Account ;
204- originalMsgHash : Hex . Hex ;
205+ originalMsgHash : ox__Hex . Hex ;
205206 defaultValidator : string ;
206207 createAccount : (
207208 factoryContract : ThirdwebContract ,
0 commit comments