From 976d4be6526580a0b4e9ff37814143332d9386a1 Mon Sep 17 00:00:00 2001 From: Chaitanya Potti Date: Tue, 24 Sep 2024 21:10:08 +0800 Subject: [PATCH] removes light, simple smart accounts --- demo/vue-app-new/src/MainView.vue | 9 ------ .../smartAccounts/LightSmartAccount.ts | 31 ------------------- .../smartAccounts/SimpleSmartAccount.ts | 30 ------------------ .../src/providers/smartAccounts/index.ts | 2 -- 4 files changed, 72 deletions(-) delete mode 100644 packages/providers/account-abstraction-provider/src/providers/smartAccounts/LightSmartAccount.ts delete mode 100644 packages/providers/account-abstraction-provider/src/providers/smartAccounts/SimpleSmartAccount.ts diff --git a/demo/vue-app-new/src/MainView.vue b/demo/vue-app-new/src/MainView.vue index 8b09e2182..d49c5b0f6 100644 --- a/demo/vue-app-new/src/MainView.vue +++ b/demo/vue-app-new/src/MainView.vue @@ -4,9 +4,7 @@ import { BiconomySmartAccount, ISmartAccount, KernelSmartAccount, - LightSmartAccount, SafeSmartAccount, - SimpleSmartAccount, TrustSmartAccount, } from "@web3auth/account-abstraction-provider"; import { CHAIN_NAMESPACES, ChainNamespaceType, IAdapter, IBaseProvider, IProvider, storageAvailable, WALLET_ADAPTERS } from "@web3auth/base"; @@ -89,19 +87,12 @@ const accountAbstractionProvider = computed((): IBaseProvider | undef case "biconomy": smartAccountInit = new BiconomySmartAccount(); break; - case "simple": - smartAccountInit = new SimpleSmartAccount(); - break; case "kernel": smartAccountInit = new KernelSmartAccount(); break; - case "light": - smartAccountInit = new LightSmartAccount(); - break; case "trust": smartAccountInit = new TrustSmartAccount(); break; - case "safe": default: smartAccountInit = new SafeSmartAccount(); diff --git a/packages/providers/account-abstraction-provider/src/providers/smartAccounts/LightSmartAccount.ts b/packages/providers/account-abstraction-provider/src/providers/smartAccounts/LightSmartAccount.ts deleted file mode 100644 index 924f8a09e..000000000 --- a/packages/providers/account-abstraction-provider/src/providers/smartAccounts/LightSmartAccount.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { IProvider } from "@web3auth/base"; -import { toLightSmartAccount, ToLightSmartAccountParameters } from "permissionless/accounts"; -import { Client, EIP1193Provider } from "viem"; -import { entryPoint07Address, SmartAccount } from "viem/account-abstraction"; - -import { ISmartAccount } from "./types"; - -type LightSmartAccountConfig = Omit; - -export class LightSmartAccount implements ISmartAccount { - private options: LightSmartAccountConfig; - - constructor(options?: LightSmartAccountConfig) { - this.options = options; - } - - async getSmartAccount( - params: { owner: IProvider; client: Client } & Pick - ): Promise { - return toLightSmartAccount({ - ...(this.options || {}), - entryPoint: { - address: this.options?.entryPoint?.address || entryPoint07Address, - version: this.options?.entryPoint?.version || "0.7", - }, - version: this.options?.version || "2.0.0", - owner: params.owner as EIP1193Provider, - client: params.client, - }); - } -} diff --git a/packages/providers/account-abstraction-provider/src/providers/smartAccounts/SimpleSmartAccount.ts b/packages/providers/account-abstraction-provider/src/providers/smartAccounts/SimpleSmartAccount.ts deleted file mode 100644 index 135056d28..000000000 --- a/packages/providers/account-abstraction-provider/src/providers/smartAccounts/SimpleSmartAccount.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { IProvider } from "@web3auth/base"; -import { toSimpleSmartAccount } from "permissionless/accounts"; -import { Client, EIP1193Provider } from "viem"; -import { entryPoint07Address, SmartAccount } from "viem/account-abstraction"; - -import { ISmartAccount } from "./types"; - -type SimpleSmartAccountParameters = Parameters[0]; // use type of function so we don't need to pass in generic to parameter type - -type SimpleSmartAccountConfig = Omit; - -export class SimpleSmartAccount implements ISmartAccount { - private options: SimpleSmartAccountConfig; - - constructor(options?: SimpleSmartAccountConfig) { - this.options = options; - } - - async getSmartAccount(params: { owner: IProvider; client: Client }): Promise { - return toSimpleSmartAccount({ - ...(this.options || {}), - entryPoint: { - address: this.options?.entryPoint?.address || entryPoint07Address, - version: this.options?.entryPoint?.version || "0.7", - }, - owner: params.owner as EIP1193Provider, - client: params.client, - }); - } -} diff --git a/packages/providers/account-abstraction-provider/src/providers/smartAccounts/index.ts b/packages/providers/account-abstraction-provider/src/providers/smartAccounts/index.ts index e1accfff8..c3dca19df 100644 --- a/packages/providers/account-abstraction-provider/src/providers/smartAccounts/index.ts +++ b/packages/providers/account-abstraction-provider/src/providers/smartAccounts/index.ts @@ -1,7 +1,5 @@ export * from "./BiconomySmartAccount"; export * from "./KernelSmartAccount"; -export * from "./LightSmartAccount"; export * from "./SafeSmartAccount"; -export * from "./SimpleSmartAccount"; export * from "./TrustSmartAccount"; export * from "./types";