-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2053 from Web3Auth/feat/pass-smart-account-config
Feat/pass smart account config
- Loading branch information
Showing
10 changed files
with
62 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
packages/providers/account-abstraction-provider/src/providers/smartAccounts/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,49 @@ | ||
import { IBaseSmartAccount, IProvider } from "@web3auth/base"; | ||
import { | ||
ToBiconomySmartAccountParameters, | ||
toEcdsaKernelSmartAccount, | ||
ToLightSmartAccountParameters, | ||
ToNexusSmartAccountParameters, | ||
toSafeSmartAccount, | ||
toSimpleSmartAccount, | ||
toTrustSmartAccount, | ||
} from "permissionless/accounts"; | ||
import { Client } from "viem"; | ||
import { SmartAccount } from "viem/account-abstraction"; | ||
|
||
export type BiconomySmartAccountConfig = Pick<ToBiconomySmartAccountParameters, "entryPoint" | "ecdsaModuleAddress" | "factoryAddress">; | ||
|
||
export type KernelSmartAccountParameters = Parameters<typeof toEcdsaKernelSmartAccount>[0]; // use type of function so we don't need to pass in generic to parameter type | ||
|
||
export type KernelSmartAccountConfig = Omit<KernelSmartAccountParameters, "owners" | "client" | "address" | "nonceKey" | "index">; | ||
|
||
export type LightSmartAccountConfig = Omit<ToLightSmartAccountParameters, "owner" | "client" | "index" | "address" | "nonceKey">; | ||
|
||
export type NexusSmartAccountConfig = Omit<ToNexusSmartAccountParameters, "owners" | "client" | "index" | "address">; | ||
|
||
export type SafeSmartAccountParameters = Parameters<typeof toSafeSmartAccount>[0]; // use type of function so we don't need to pass in generic to parameter type | ||
|
||
export type SafeSmartAccountConfig = Omit< | ||
SafeSmartAccountParameters, | ||
"owners" | "client" | "address" | "nonceKey" | "saltNonce" | "validUntil" | "validAfter" | ||
>; | ||
|
||
export type SimpleSmartAccountParameters = Parameters<typeof toSimpleSmartAccount>[0]; // use type of function so we don't need to pass in generic to parameter type | ||
|
||
export type SimpleSmartAccountConfig = Omit<SimpleSmartAccountParameters, "owner" | "client">; | ||
|
||
export type TrustSmartAccountParameters = Parameters<typeof toTrustSmartAccount>[0]; // use type of function so we don't need to pass in generic to parameter type | ||
|
||
export type TrustSmartAccountConfig = Omit<TrustSmartAccountParameters, "owner" | "client" | "address" | "nonceKey" | "index">; | ||
|
||
export interface ISmartAccount extends IBaseSmartAccount { | ||
options: | ||
| BiconomySmartAccountConfig | ||
| KernelSmartAccountConfig | ||
| NexusSmartAccountConfig | ||
| SafeSmartAccountConfig | ||
| TrustSmartAccountConfig | ||
| LightSmartAccountConfig | ||
| SimpleSmartAccountConfig; | ||
getSmartAccount(params: { owner: IProvider; client: Client }): Promise<SmartAccount>; | ||
} |