@@ -9,9 +9,7 @@ import { getV4TypedData } from "../config";
99export const walletSignPersonalMessage = async ( provider : WalletServicesPlugin [ "provider" ] , uiConsole : any ) => {
1010 try {
1111 const ethProvider = new BrowserProvider ( provider ) ;
12- const accounts = await provider . request ( { method : "eth_accounts" } ) ;
13- const smartAccountAddress = accounts [ 1 ] ;
14- const signer = await ethProvider . getSigner ( smartAccountAddress ) ;
12+ const signer = await ethProvider . getSigner ( ) ;
1513 const account = await signer . getAddress ( ) ;
1614 const from = account ;
1715
@@ -37,9 +35,7 @@ export const walletSignPersonalMessage = async (provider: WalletServicesPlugin["
3735export const walletSignTypedMessage = async ( provider : WalletServicesPlugin [ "provider" ] , uiConsole : any ) => {
3836 try {
3937 const ethProvider = new BrowserProvider ( provider ) ;
40- const accounts = await provider . request ( { method : "eth_accounts" } ) ;
41- const smartAccountAddress = accounts [ 1 ] ;
42- const signer = await ethProvider . getSigner ( smartAccountAddress ) ;
38+ const signer = await ethProvider . getSigner ( ) ;
4339 const account = await signer . getAddress ( ) ;
4440 const from = account ;
4541 const typedData = getV4TypedData ( provider . chainId ) ;
@@ -63,9 +59,7 @@ export const walletSignTypedMessage = async (provider: WalletServicesPlugin["pro
6359export const walletSendEth = async ( provider : WalletServicesPlugin [ "provider" ] , uiConsole : any ) => {
6460 try {
6561 const ethProvider = new BrowserProvider ( provider ) ;
66- const accounts = await provider . request ( { method : "eth_accounts" } ) ;
67- const smartAccountAddress = accounts [ 1 ] ;
68- const signer = await ethProvider . getSigner ( smartAccountAddress ) ;
62+ const signer = await ethProvider . getSigner ( ) ;
6963 const account = await signer . getAddress ( ) ;
7064 const txRes = await signer . sendTransaction ( {
7165 from : account ,
@@ -84,7 +78,7 @@ export const walletSignTransaction = async (provider: WalletServicesPlugin["prov
8478 try {
8579 const ethProvider = new BrowserProvider ( provider ) ;
8680 const accounts = await provider . request ( { method : "eth_accounts" } ) ;
87- const smartAccountAddress = accounts [ 1 ] ;
81+ const smartAccountAddress = accounts [ 0 ] ;
8882 const signer = await ethProvider . getSigner ( smartAccountAddress ) ;
8983 const account = await signer . getAddress ( ) ;
9084 // only supported with social logins (openlogin adapter)
0 commit comments