@@ -8,7 +8,7 @@ import { custom, createWalletClient } from "viem"
8
8
import { sepolia } from "viem/chains"
9
9
import { entryPoint07Address } from "viem/account-abstraction"
10
10
import { toAccount } from "viem/accounts"
11
- const { toSafeSmartAccount } = require ( "permissionless/accounts" )
11
+ const { toSafeSmartAccount } = require ( "permissionless/accounts" ) /* eslint-disable-line @typescript-eslint/no-var-requires */
12
12
13
13
export const updateAccountBalances = async ( plugin : RunTab , dispatch : React . Dispatch < any > ) => {
14
14
const accounts = plugin . REACT_API . accounts . loadedAccounts
@@ -97,26 +97,27 @@ export const createSmartAccount = async (plugin: RunTab, dispatch: React.Dispatc
97
97
98
98
// @ts -ignore
99
99
const [ account ] = await window . ethereum ! . request ( { method : 'eth_requestAccounts' } )
100
- console . log ( 'account---accounts->' , account )
101
-
100
+ console . log ( 'account---accounts->' , account )
101
+
102
102
const walletClient = createWalletClient ( {
103
103
account,
104
104
chain : sepolia ,
105
105
transport : custom ( window . ethereum ! ) ,
106
106
} )
107
107
108
108
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"
117
117
} )
118
118
119
119
console . log ( 'safeAccount----->' , safeAccount . address )
120
+ return plugin . call ( 'notification' , 'toast' , `Safe account ${ safeAccount . address } created for owner ${ account } ` )
120
121
}
121
122
122
123
export const signMessageWithAddress = ( plugin : RunTab , dispatch : React . Dispatch < any > , account : string , message : string , modalContent : ( hash : string , data : string ) => JSX . Element , passphrase ?: string ) => {
0 commit comments