@@ -8,7 +8,7 @@ import { custom, createWalletClient } from "viem"
88import { sepolia } from "viem/chains"
99import { entryPoint07Address } from "viem/account-abstraction"
1010import { toAccount } from "viem/accounts"
11- const { toSafeSmartAccount } = require ( "permissionless/accounts" )
11+ const { toSafeSmartAccount } = require ( "permissionless/accounts" ) /* eslint-disable-line @typescript-eslint/no-var-requires */
1212
1313export const updateAccountBalances = async ( plugin : RunTab , dispatch : React . Dispatch < any > ) => {
1414 const accounts = plugin . REACT_API . accounts . loadedAccounts
@@ -97,26 +97,27 @@ export const createSmartAccount = async (plugin: RunTab, dispatch: React.Dispatc
9797
9898 // @ts -ignore
9999 const [ account ] = await window . ethereum ! . request ( { method : 'eth_requestAccounts' } )
100- console . log ( 'account---accounts->' , account )
101-
100+ console . log ( 'account---accounts->' , account )
101+
102102 const walletClient = createWalletClient ( {
103103 account,
104104 chain : sepolia ,
105105 transport : custom ( window . ethereum ! ) ,
106106 } )
107107
108108 const safeAccount = await toSafeSmartAccount ( {
109- client : walletClient ,
110- entryPoint : {
111- address : entryPoint07Address ,
112- version : "0.7" ,
113- } ,
114- owners : [ toAccount ( account ) ] ,
115- // saltNonce: 0n, // optional
116- version : "1.4.1"
109+ client : walletClient ,
110+ entryPoint : {
111+ address : entryPoint07Address ,
112+ version : "0.7" ,
113+ } ,
114+ owners : [ toAccount ( account ) ] ,
115+ // saltNonce: 0n, // optional
116+ version : "1.4.1"
117117 } )
118118
119119 console . log ( 'safeAccount----->' , safeAccount . address )
120+ return plugin . call ( 'notification' , 'toast' , `Safe account ${ safeAccount . address } created for owner ${ account } ` )
120121}
121122
122123export const signMessageWithAddress = ( plugin : RunTab , dispatch : React . Dispatch < any > , account : string , message : string , modalContent : ( hash : string , data : string ) => JSX . Element , passphrase ?: string ) => {
0 commit comments