-
-
Notifications
You must be signed in to change notification settings - Fork 977
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: more smart account impl via permissionless (#2961)
* Add support for multiple smart accounts via permissionless * tweaks * chore: format --------- Co-authored-by: jxom <[email protected]>
- Loading branch information
1 parent
2b62d70
commit a7cdd5c
Showing
10 changed files
with
467 additions
and
25 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
68 changes: 68 additions & 0 deletions
68
site/pages/account-abstraction/accounts/smart/toEcdsaKernelSmartAccount.md
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,68 @@ | ||
# Kernel | ||
|
||
:::warning | ||
**Note:** This implementation is maintained & distributed by [permissionless.js](https://docs.pimlico.io/permissionless). | ||
::: | ||
|
||
To implement the [Kernel Smart Wallet](https://github.com/zerodevapp/kernel), you can use the [`toEcdsaKernelSmartAccount`](https://docs.pimlico.io/permissionless/reference/accounts/toEcdsaKernelSmartAccount) module from [permissionless.js](https://docs.pimlico.io/permissionless/) | ||
|
||
## Install | ||
|
||
:::code-group | ||
```bash [pnpm] | ||
pnpm add permissionless | ||
``` | ||
|
||
```bash [npm] | ||
npm install permissionless | ||
``` | ||
|
||
```bash [yarn] | ||
yarn add permissionless | ||
``` | ||
|
||
```bash [bun] | ||
bun add permissionless | ||
``` | ||
::: | ||
|
||
## Usage | ||
|
||
:::code-group | ||
|
||
```ts twoslash [example.ts] | ||
import { toEcdsaKernelSmartAccount } from 'permissionless/accounts' // [!code focus] | ||
import { client } from './client.js' | ||
import { owner } from './owner.js' | ||
|
||
const account = await toEcdsaKernelSmartAccount({ // [!code focus] | ||
client, // [!code focus] | ||
owners: [owner], // [!code focus] | ||
version: '0.3.1', // [!code focus] | ||
}) // [!code focus] | ||
``` | ||
|
||
```ts twoslash [client.ts] filename="config.ts" | ||
import { http, createPublicClient } from 'viem' | ||
import { mainnet } from 'viem/chains' | ||
|
||
export const client = createPublicClient({ | ||
chain: mainnet, | ||
transport: http(), | ||
}) | ||
``` | ||
|
||
```ts twoslash [owner.ts (Private Key)] filename="owner.ts" | ||
import { privateKeyToAccount } from 'viem/accounts' | ||
|
||
export const owner = privateKeyToAccount('0x...') | ||
``` | ||
::: | ||
|
||
## Returns | ||
|
||
`SmartAccount<EcdsaKernelSmartAccountImplementation>` | ||
|
||
## Parameters | ||
|
||
[See Parameters](https://docs.pimlico.io/permissionless/reference/accounts/toEcdsaKernelSmartAccount#parameters) |
68 changes: 68 additions & 0 deletions
68
site/pages/account-abstraction/accounts/smart/toLightSmartAccount.md
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,68 @@ | ||
# Light | ||
|
||
:::warning | ||
**Note:** This implementation is maintained & distributed by [permissionless.js](https://docs.pimlico.io/permissionless). | ||
::: | ||
|
||
To implement Alchemy's [Light Smart Wallet](https://github.com/alchemyplatform/light-account), you can use the [`toLightSmartAccount`](https://docs.pimlico.io/permissionless/reference/accounts/toLightSmartAccount) module from [permissionless.js](https://docs.pimlico.io/permissionless/) | ||
|
||
## Install | ||
|
||
:::code-group | ||
```bash [pnpm] | ||
pnpm add permissionless | ||
``` | ||
|
||
```bash [npm] | ||
npm install permissionless | ||
``` | ||
|
||
```bash [yarn] | ||
yarn add permissionless | ||
``` | ||
|
||
```bash [bun] | ||
bun add permissionless | ||
``` | ||
::: | ||
|
||
## Usage | ||
|
||
:::code-group | ||
|
||
```ts twoslash [example.ts] | ||
import { toLightSmartAccount } from 'permissionless/accounts' // [!code focus] | ||
import { client } from './client.js' | ||
import { owner } from './owner.js' | ||
|
||
const account = await toLightSmartAccount({ // [!code focus] | ||
client, // [!code focus] | ||
owner: owner, // [!code focus] | ||
version: '2.0.0', // [!code focus] | ||
}) // [!code focus] | ||
``` | ||
|
||
```ts twoslash [client.ts] filename="config.ts" | ||
import { http, createPublicClient } from 'viem' | ||
import { mainnet } from 'viem/chains' | ||
|
||
export const client = createPublicClient({ | ||
chain: mainnet, | ||
transport: http(), | ||
}) | ||
``` | ||
|
||
```ts twoslash [owner.ts (Private Key)] filename="owner.ts" | ||
import { privateKeyToAccount } from 'viem/accounts' | ||
|
||
export const owner = privateKeyToAccount('0x...') | ||
``` | ||
::: | ||
|
||
## Returns | ||
|
||
`SmartAccount<LightSmartAccountImplementation>` | ||
|
||
## Parameters | ||
|
||
[See Parameters](https://docs.pimlico.io/permissionless/reference/accounts/toLightSmartAccount#parameters) |
Oops, something went wrong.