From 58321522fa1687b6adc4ee47f8f0b6d645723112 Mon Sep 17 00:00:00 2001 From: Nobuhito Kurose Date: Sat, 15 Apr 2023 23:01:17 +0900 Subject: [PATCH] remove old social recovery function --- packages/site/src/snapMock/aaWallet.ts | 41 -------------------------- 1 file changed, 41 deletions(-) diff --git a/packages/site/src/snapMock/aaWallet.ts b/packages/site/src/snapMock/aaWallet.ts index 0403112..af7fa29 100644 --- a/packages/site/src/snapMock/aaWallet.ts +++ b/packages/site/src/snapMock/aaWallet.ts @@ -311,44 +311,3 @@ export const setupSocialRecovery = async ({ return txHash; }; - -export const executeSocialRecovery = async (signature: string) => { - const aaProvider = new ethers.providers.JsonRpcProvider(config.rpcUrl); - const ethProvider = new ethers.providers.Web3Provider( - window.ethereum as unknown as BaseProvider, - ); - - await ethProvider.send('eth_requestAccounts', []); - const signer = ethProvider.getSigner(); - - const accountAPI = new SimpleAccountAPI({ - provider: aaProvider, - owner: signer, - entryPointAddress, - factoryAddress, - }); - const myAddress = await accountAPI.getAccountAddress(); - const myContract = new Contract(myAddress, WalletAccount.abi, aaProvider); - const op = await accountAPI.createSignedUserOp({ - target: myAddress, - data: myContract.interface.encodeFunctionData('executeSocialRecovery', [ - signature, - ]), - maxPriorityFeePerGas: 0x2540be400, // 15gwei - maxFeePerGas: 0x6fc23ac00, // 30gewi - }); - - const client = new HttpRpcClient( - bundlerUrl, - entryPointAddress, - Number(ChainId.mumbai), - ); - - const uoHash = await client.sendUserOpToBundler(op); - console.log(`UserOpHash: ${uoHash}`); - - console.log('Waiting for transaction...'); - const txHash = await accountAPI.getUserOpReceipt(uoHash); - console.log(`Transaction hash: ${txHash}`); - return txHash; -};