Skip to content

Commit

Permalink
update demo wallet-service handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
lionellbriones committed Nov 29, 2024
1 parent 8a981e5 commit 6c62f09
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions demo/vue-app-new/src/services/walletServiceHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import { getV4TypedData } from "../config";
export const walletSignPersonalMessage = async (provider: WalletServicesPlugin["provider"], uiConsole: any) => {
try {
const ethProvider = new BrowserProvider(provider);
const accounts = await provider.request({ method: "eth_accounts" });
const smartAccountAddress = accounts[1];
const signer = await ethProvider.getSigner(smartAccountAddress);
const signer = await ethProvider.getSigner();
const account = await signer.getAddress();
const from = account;

Expand All @@ -37,9 +35,7 @@ export const walletSignPersonalMessage = async (provider: WalletServicesPlugin["
export const walletSignTypedMessage = async (provider: WalletServicesPlugin["provider"], uiConsole: any) => {
try {
const ethProvider = new BrowserProvider(provider);
const accounts = await provider.request({ method: "eth_accounts" });
const smartAccountAddress = accounts[1];
const signer = await ethProvider.getSigner(smartAccountAddress);
const signer = await ethProvider.getSigner();
const account = await signer.getAddress();
const from = account;
const typedData = getV4TypedData(provider.chainId);
Expand All @@ -63,9 +59,7 @@ export const walletSignTypedMessage = async (provider: WalletServicesPlugin["pro
export const walletSendEth = async (provider: WalletServicesPlugin["provider"], uiConsole: any) => {
try {
const ethProvider = new BrowserProvider(provider);
const accounts = await provider.request({ method: "eth_accounts" });
const smartAccountAddress = accounts[1];
const signer = await ethProvider.getSigner(smartAccountAddress);
const signer = await ethProvider.getSigner();
const account = await signer.getAddress();
const txRes = await signer.sendTransaction({
from: account,
Expand All @@ -84,7 +78,7 @@ export const walletSignTransaction = async (provider: WalletServicesPlugin["prov
try {
const ethProvider = new BrowserProvider(provider);
const accounts = await provider.request({ method: "eth_accounts" });
const smartAccountAddress = accounts[1];
const smartAccountAddress = accounts[0];
const signer = await ethProvider.getSigner(smartAccountAddress);
const account = await signer.getAddress();
// only supported with social logins (openlogin adapter)
Expand Down

0 comments on commit 6c62f09

Please sign in to comment.