1
- import { AbiParameters , Hex } from "ox" ;
1
+ import * as ox__AbiParameters from "ox/AbiParameters" ;
2
+ import * as ox__Hex from "ox/Hex" ;
2
3
import { serializeErc6492Signature } from "../../../auth/serialize-erc6492-signature.js" ;
3
4
import { verifyHash } from "../../../auth/verify-hash.js" ;
4
5
import { ZERO_ADDRESS } from "../../../constants/addresses.js" ;
@@ -56,9 +57,9 @@ export type ERC7579Config = SmartWalletOptions & {
56
57
export function erc7579 ( options : ERC7579Config ) : SmartWalletOptions {
57
58
const saltHex =
58
59
options . overrides ?. accountSalt &&
59
- Hex . validate ( options . overrides . accountSalt )
60
+ ox__Hex . validate ( options . overrides . accountSalt )
60
61
? options . overrides . accountSalt
61
- : Hex . fromString ( options . overrides ?. accountSalt ?? "" ) ;
62
+ : ox__Hex . fromString ( options . overrides ?. accountSalt ?? "" ) ;
62
63
const defaultValidator = getAddress ( options . validatorAddress ) ;
63
64
const modularAccountOptions : SmartWalletOptions = {
64
65
...options ,
@@ -75,7 +76,7 @@ export function erc7579(options: ERC7579Config): SmartWalletOptions {
75
76
{
76
77
moduleTypeId : 1n , // validator type id
77
78
module : defaultValidator ,
78
- initData : Hex . fromString ( "" ) ,
79
+ initData : ox__Hex . fromString ( "" ) ,
79
80
} ,
80
81
] ;
81
82
return {
@@ -99,8 +100,8 @@ export function erc7579(options: ERC7579Config): SmartWalletOptions {
99
100
contract : accountContract ,
100
101
async asyncParams ( ) {
101
102
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 (
104
105
[ "address" , "uint256" , "bytes" ] ,
105
106
[
106
107
transaction . to || ZERO_ADDRESS ,
@@ -117,8 +118,8 @@ export function erc7579(options: ERC7579Config): SmartWalletOptions {
117
118
contract : accountContract ,
118
119
async asyncParams ( ) {
119
120
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 (
122
123
[
123
124
{
124
125
type : "tuple[]" ,
@@ -152,10 +153,10 @@ export function erc7579(options: ERC7579Config): SmartWalletOptions {
152
153
sender : accountContract . address ,
153
154
} ) ;
154
155
// 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 ) } ` ,
157
158
) ;
158
- return Hex . toBigInt ( withValidator ) ;
159
+ return ox__Hex . toBigInt ( withValidator ) ;
159
160
} ,
160
161
async signMessage ( options ) {
161
162
const { accountContract, factoryContract, adminAccount, message } =
@@ -201,7 +202,7 @@ async function generateSignature(options: {
201
202
accountContract : ThirdwebContract ;
202
203
factoryContract : ThirdwebContract ;
203
204
adminAccount : Account ;
204
- originalMsgHash : Hex . Hex ;
205
+ originalMsgHash : ox__Hex . Hex ;
205
206
defaultValidator : string ;
206
207
createAccount : (
207
208
factoryContract : ThirdwebContract ,
0 commit comments