forked from alchemyplatform/aa-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add docs for using and contributing custom accounts
- Loading branch information
Showing
9 changed files
with
78 additions
and
117 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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
outline: deep | ||
head: | ||
- - meta | ||
- property: og:title | ||
content: Using Your Own Smart Account | ||
- - meta | ||
- name: description | ||
content: Follow this guide to use any smart account implementation you want with Account Kit, a vertically integrated stack for building apps that support ERC-4337. | ||
- - meta | ||
- property: og:description | ||
content: Follow this guide to use any smart account implementation you want with Account Kit, a vertically integrated stack for building apps that support ERC-4337. | ||
- - meta | ||
- name: twitter:title | ||
content: Using Your Own Smart Account | ||
- - meta | ||
- name: twitter:description | ||
content: Follow this guide to use any smart account implementation you want with Account Kit, a vertically integrated stack for building apps that support ERC-4337. | ||
--- | ||
|
||
# Using Your Own Smart Account | ||
|
||
You are not limited to the accounts defined in `@alchemy/aa-accounts`. The `SmartAccountProvider` can be used with any smart account because it only relies on the [`ISmartContractAccount`](https://github.com/alchemyplatform/aa-sdk/blob/main/packages/core/src/account/types.ts#L8) interface. This means you can use your own smart account implementation with Account Kit. | ||
|
||
<!--@include: ../../packages/aa-core/accounts/index.md{21,58}--> | ||
|
||
## `LightSmartContractAccount` as an Example | ||
|
||
We have built an extension of the eth-infinitism `SimpleAccount` called [LightAccount.sol](https://github.com/alchemyplatform/light-account/blob/main/src/LightAccount.sol). You can learn more about Light Account in the [Light Account documentation](/smart-accounts/light-account/). | ||
|
||
We provide an implementation of `SmartContractAccount` that works with `LightAccount.sol` which can be used as an example of how to implement your own Smart Contract Account: | ||
::: details LightSmartContractAccount | ||
<<< @/../packages/accounts/src/light-account/account.ts | ||
::: | ||
|
||
## The `toSmartContractAccount` Method | ||
|
||
For your reference, this is the definition of the `toSmartContractAccount` interface as pulled from the source code: | ||
|
||
::: details SmartContractAccount | ||
<<< @/../packages/core/src/account/smartContractAccount.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
outline: deep | ||
head: | ||
- - meta | ||
- property: og:title | ||
content: Gas Benchmarks | ||
- - meta | ||
- name: description | ||
content: Gas Benchmarks for Alchemy Accounts | ||
- - meta | ||
- property: og:description | ||
content: Gas Benchmarks for Alchemy Accounts | ||
--- | ||
|
||
# Account Gas Benchmarks | ||
|
||
| Account | Native transfer | ERC20 transfer | Creation | | ||
| ----------------------------------------------------------------------------------------------------------------------- | --------------- | -------------- | -------- | | ||
| Alchemy Light Account | 100844 | 90345 | 279746 | | ||
| Kernel v2.1-lite | 101002 | 90321 | 230968 | | ||
| [SimpleAccount](https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol) | 101319 | 90907 | 383218 | | ||
| Etherspot | 103719 | 93324 | 279219 | | ||
| Biconomy | 104408 | 93730 | 270013 | | ||
| Kernel v2.1 | 106460 | 96038 | 265215 | | ||
| Kernel v2.0 | 110018 | 99622 | 339882 | |
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