Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ By allowing you to swap between base tokens and DeFi tokens, you can easily:
- Swap between any token pairs.
- Entering and exiting DeFi positions (staking, lending, etc.)

ZeroDev leverages [batching](/sdk/core-api/batch-transactions) and [delegatecall](/sdk/core-api/delegatecall) internally to ensure that even complex routes are executed in one atomic UserOp, providing the user with low latency, low gas cost, and high safety.
ZeroDev leverages [batching](/smart-accounts/batch-transactions) and [delegatecall](/advanced/delegatecall) internally to ensure that even complex routes are executed in one atomic UserOp, providing the user with low latency, low gas cost, and high safety.

## Supported Tokens

See the full lists of supported base tokens and DeFi tokens:

- [Base tokens](/sdk/advanced/supported-base-tokens)
- [DeFi tokens (protocols)](/sdk/advanced/supported-defi-tokens)
- [Base tokens](/cross-chain/chain-abstraction/supported-base-tokens)
- [DeFi tokens (protocols)](/cross-chain/chain-abstraction/supported-defi-tokens)

## Installation

Expand Down Expand Up @@ -61,7 +61,7 @@ const defiClient = createKernelDefiClient(kernelClient, projectId)

Where:

- `kernelClient` is the [account client](/sdk/core-api/create-account#create-an-account-client) object.
- `kernelClient` is the [account client](/smart-accounts/create-a-smart-account#create-an-account-client) object.
- `projectId` is your ZeroDev project ID, obtained from the dashboard.

### Swapping Tokens
Expand Down Expand Up @@ -161,10 +161,10 @@ const accountBalances = await defiClient.listTokenBalances({
The `gasToken` flag specifies how gas is paid for the UserOp. It can be one of the following values:

- `sponsored`: sponsor the UserOp.
- `fromToken`: pays gas in the input token, using a [ERC20 paymaster](/sdk/core-api/pay-gas-with-erc20s).
- `toToken`: pays gas in the output token, using a [ERC20 paymaster](/sdk/core-api/pay-gas-with-erc20s).
- `fromToken`: pays gas in the input token, using a [ERC20 paymaster](/smart-accounts/pay-gas-with-erc20s).
- `toToken`: pays gas in the output token, using a [ERC20 paymaster](/smart-accounts/pay-gas-with-erc20s).
- `native`: pays gas in the native token, using the account's balance.
- You can also specify an `Address` for a ERC20 token, to pay gas with that token using a [ERC20 paymaster](/sdk/core-api/pay-gas-with-erc20s).
- You can also specify an `Address` for a ERC20 token, to pay gas with that token using a [ERC20 paymaster](/smart-accounts/pay-gas-with-erc20s).

### Getting the UserOp without sending

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ In the previous example, we used different providers as fallbacks through ZeroDe

To do that, simply:

- [Set up a Kernel account client with Pimlico](/sdk/infra/pimlico).
- [Set up a Kernel account client with Pimlico](/resources/infrastructure/pimlico).

Then combine them with `createFallbackKernelAccountClient`:

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const remoteSigner = await toRemoteSigner({

Since `remoteSigner` is a [Viem account](https://viem.sh/docs/accounts/privateKey), you can use it wherever a Viem account is expected.

For example, to use the remote signer as a [session key](/sdk/permissions/intro):
For example, to use the remote signer as a [session key](/smart-accounts/permissions/intro):

```ts
const ecdsaSigner = toECDSASigner({ signer: remoteSigner })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Of course, you can also simply copy the RPC for different chains from the dashbo
<img src="/img/multichain-project.png" width="50%" />
</p>

The same RPC can then be used as both the bundler RPC and the paymaster RPC. See [the tutorial](/sdk/getting-started/tutorial#creating-a-kernel-client) for an example.
The same RPC can then be used as both the bundler RPC and the paymaster RPC. See [the tutorial](/get-started/quickstart#creating-a-kernel-client) for an example.

## SDK 5.3.x => 5.4.x

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ZeroDev's React SDK is called `@zerodev/waas`, which stands for Wallet-as-a-Service. This is to signal that the React SDK provides higher-level abstractions over the [low-level SDK](/).

The relationship between `@zerodev/waas` and `@zerodev/sdk` is similar to the relationship between Wagmi and Viem. We recommend using `@zerodev/waas` in all React projects, and you can always ["drop down" to the SDK](/react/use-kernelclient) if you want lower-level control.
The relationship between `@zerodev/waas` and `@zerodev/sdk` is similar to the relationship between Wagmi and Viem. We recommend using `@zerodev/waas` in all React projects, and you can always ["drop down" to the SDK](/advanced/react-hooks/use-kernelclient) if you want lower-level control.

## Installation

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import QueryResult from "../shared/query-result.mdx"
import QueryResult from "../../shared/query-result.mdx"

# useBalance [Hook for getting balance of kernel account]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MutationResult from '../shared/mutation-result.mdx'
import MutationResult from '../../shared/mutation-result.mdx'

# useCreateBasicSession [Hook for creating session for kernel v2 account]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MutationResult from '../shared/mutation-result.mdx'
import MutationResult from '../../shared/mutation-result.mdx'

# useCreateKernelClientEOA [Hook for creating kernel client with EOA]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MutationResult from '../shared/mutation-result.mdx'
import MutationResult from '../../shared/mutation-result.mdx'

# useCreateKernelClientPasskey [Hook for creating kernel client with Passkey]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MutationResult from '../shared/mutation-result.mdx'
import MutationResult from '../../shared/mutation-result.mdx'

# useCreateKernelClientSocial [Hook for creating a kernel client with social login integration]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MutationResult from '../shared/mutation-result.mdx'
import MutationResult from '../../shared/mutation-result.mdx'

# useCreateSession [Hook for creating session for kernel v3 account]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MutationResult from '../shared/mutation-result.mdx'
import MutationResult from '../../shared/mutation-result.mdx'

# useDisconnectKernelClient [Hook for disconnecting kernel account client]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import QueryResult from "../shared/query-result.mdx"
import QueryResult from "../../shared/query-result.mdx"

# useKernelClient [Hook for getting kernel account client]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MutationResult from '../shared/mutation-result.mdx'
import MutationResult from '../../shared/mutation-result.mdx'

# useSendTransactionWithSession [Hooks for sending transactions with session keys]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MutationResult from '../shared/mutation-result.mdx'
import MutationResult from '../../shared/mutation-result.mdx'

# useSendTransaction [Hook for sending transaction]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MutationResult from '../shared/mutation-result.mdx'
import MutationResult from '../../shared/mutation-result.mdx'

# useSendUserOperationWithSession [Hooks for sending user operation with session keys]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MutationResult from '../shared/mutation-result.mdx'
import MutationResult from '../../shared/mutation-result.mdx'

# useSendUserOperation [Hook for sending user operation]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import QueryResult from "../shared/query-result.mdx"
import QueryResult from "../../shared/query-result.mdx"

# useSessionKernelClient [Hook for getting kernel account client with session plugin]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MutationResult from '../shared/mutation-result.mdx'
import MutationResult from '../../shared/mutation-result.mdx'

# useSetKernelClient [Hook for setting kernel account client]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MutationResult from '../shared/mutation-result.mdx'
import MutationResult from '../../shared/mutation-result.mdx'

# useSwitchChain [Hook for switching chain]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ await walletConnectKernelService.init({
- `walletConnectProjectId`: Your WalletConnect project ID. You will get this from the [WalletConnect dashboard.](https://cloud.walletconnect.com/sign-in)
- `walletConnectMetadata`: Metadata related to the WalletConnect session.
- `kernelClient`: An optional kernel client for creating a kernel provider.
- For detailed information on kernel clients, see [the kernel clients documentation.](/sdk/core-api/create-account#create-an-account-client)
- For detailed information on kernel clients, see [the kernel clients documentation.](/smart-accounts/create-a-smart-account#create-an-account-client)
- `kernelProvider`: An optional pre-initialized kernel provider.
- If you are using wagmi with the capabilities pattern (for more information, see [the capabilities quickstart](/smart-wallet/quickstart-capabilities)), you can get the `kernelProvider` from wagmi.
- If you are using wagmi with the capabilities pattern (for more information, see [the capabilities quickstart](/get-started/quickstart)), you can get the `kernelProvider` from wagmi.

```typescript
import { useAccount } from "wagmi";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

ZeroDev is compatible with any account abstraction infra provider. Check out these guides for integrating with a specific provider:

- [ZeroDev](/meta-infra/intro)
- [Pimlico](/sdk/infra/pimlico)
- [ZeroDev](/resources/infrastructure/intro)
- [Pimlico](/resources/infrastructure/pimlico)

Read on to learn how to integrate with a custom provider.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

[Coinbase Developer Platform](https://docs.cdp.coinbase.com/) (CDP) offers bundler and paymaster services that you can use with ZeroDev.

Generally speaking, Coinbase bundlers & paymasters speak the same interface as Pimlico, so you can follow [this guide](/sdk/infra/pimlico) and simply replace the Pimlico bundler/paymaster URLs with the CDP bundler/paymaster URLs.
Generally speaking, Coinbase bundlers & paymasters speak the same interface as Pimlico, so you can follow [this guide](/resources/infrastructure/pimlico) and simply replace the Pimlico bundler/paymaster URLs with the CDP bundler/paymaster URLs.

You can also refer to [CDP's official examples for ZeroDev](https://github.com/coinbase/paymaster-bundler-examples/tree/master/examples/zerodev).
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

You can configure **gas policies** for ZeroDev paymaster to have fine-grained control over what you sponsor, and how much.

Paymaster policies can be configured through either [the dashboard](https://dashboard.zerodev.app/paymasters) or [the API](/meta-infra/api).
Paymaster policies can be configured through either [the dashboard](https://dashboard.zerodev.app/paymasters) or [the API](/resources/infrastructure/api).

## Policy Types

Expand All @@ -11,7 +11,7 @@ There are four types of gas policies on ZeroDev:
- Project policies: policies that apply to the entire project.
- Contract policies: policies that apply to specific contracts.
- Wallet policies: policies that apply to specific wallet addresses.
- [Custom policies](/meta-infra/custom-gas-policies): if none of the policies above meet your needs, you can program totally custom policies via a webhook.
- [Custom policies](/resources/infrastructure/custom-gas-policies): if none of the policies above meet your needs, you can program totally custom policies via a webhook.

## Rate Limit Types

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ZeroDev works with major AA infra providers to provide a "meta intrastructure."

ZeroDev integrates with the following infra provider:

- [UltraRelay](/sdk/core-api/sponsor-gas#ultrarelay), ZeroDev's own bundler optimized for sponsored transactions
- [UltraRelay](/smart-accounts/sponsor-gas/evm#ultrarelay), ZeroDev's own bundler optimized for sponsored transactions
- Alchemy
- Gelato
- Pimlico
Expand All @@ -21,10 +21,10 @@ You will need an RPC to start using bundlers & paymasters through ZeroDev.

The same RPC can be used as both bundler and paymaster RPCs.

[Learn more about bundler & paymaster RPCs here](/meta-infra/rpcs).
[Learn more about bundler & paymaster RPCs here](/resources/infrastructure/rpcs).

## Setting up sponsoring policies

If you would like to sponsor gas for your users, you need to set up gas policies on the dashboard.

[Learn more about gas policies here.](/meta-infra/gas-policies)
[Learn more about gas policies here.](/resources/infrastructure/gas-policies)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ You can use the ZeroDev SDK with Pimlico bundlers.

## Using Pimlico bundler

Simply specify Pimlico's bundler RPC when [constructing a Kernel client](/sdk/core-api/create-account#standard-api):
Simply specify Pimlico's bundler RPC when [constructing a Kernel client](/smart-accounts/create-a-smart-account#standard-api):

```typescript
import { createKernelAccountClient } from "@zerodev/sdk"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

To ensure utmost reliability for our customers, our RPCs use multiple bundlers under the hood, including:

- [UltraRelay](/sdk/core-api/sponsor-gas#ultrarelay), ZeroDev's own bundler optimized for sponsored transactions
- [UltraRelay](/smart-accounts/sponsor-gas/evm#ultrarelay), ZeroDev's own bundler optimized for sponsored transactions
- Alchemy
- Gelato
- Pimlico
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# ZeroDev

ZeroDev provides a meta infrastructure that proxies traffic to multiple infra providers including Alchemy, Gelato and Pimlico. [Read more here](/meta-infra/intro).
ZeroDev provides a meta infrastructure that proxies traffic to multiple infra providers including Alchemy, Gelato and Pimlico. [Read more here](/resources/infrastructure/intro).
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Generally speaking, there will be a preset for each `<infra provider, account ty

Click the links below to see presets for different infra providers:

- [ZeroDev](/sdk/presets/zerodev)
- [ZeroDev](/resources/presets/zerodev)
- Pimlico
- Alchemy
- Gelato
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ const kernelClient = await createEcdsaKernelAccountClient({
- `chain` is a [Viem chain object](https://viem.sh/docs/clients/chains.html)
- `projectId` is a ZeroDev project ID from the [ZeroDev dashboard](https://dashboard.zerodev.app/).
- `signer` is a [Viem account](https://viem.sh/docs/accounts/local.html).
- (optional) `provider` can be [any provider that ZeroDev supports](/meta-infra/intro).
- (optional) `provider` can be [any provider that ZeroDev supports](/resources/infrastructure/intro).
- (optional) `index` can be any positive integer. Different indexes will yield different accounts.
- (optional) `paymaster` can be:
- `'NONE'`: not using any paymaster (the user pays their own gas).
- `'SPONSOR'` (default): sponsor gas for users according to [gas policies](/meta-infra/gas-policies).
- A ERC20 token address: use the specified ERC20 token as gas tokens. See the [ERC20 gas token docs](/sdk/core-api/pay-gas-with-erc20s) for details.
- `'SPONSOR'` (default): sponsor gas for users according to [gas policies](/resources/infrastructure/gas-policies).
- A ERC20 token address: use the specified ERC20 token as gas tokens. See the [ERC20 gas token docs](/smart-accounts/pay-gas-with-erc20s) for details.

is a boolean flag that determines whether ZeroDev will use [the sponsoring paymaster](/meta-infra/intro).
is a boolean flag that determines whether ZeroDev will use [the sponsoring paymaster](/resources/infrastructure/intro).
4 changes: 2 additions & 2 deletions docs/pages/blog/7702-adoption.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ In short, it's incorrect to say either 1) that 7702 improves wallet security, or

7702 improves security because:

- With [session keys](/sdk/advanced/session-keys) (otherwise known as "privilege de-escalation" or "subkeys"), you can interact with DApps in a "sandboxed" way, so that even a malicious dapp cannot steal everything from you. This significantly reduces the probability and harm of phishing attacks.
- With [session keys](/smart-accounts/permissions/session-keys) (otherwise known as "privilege de-escalation" or "subkeys"), you can interact with DApps in a "sandboxed" way, so that even a malicious dapp cannot steal everything from you. This significantly reduces the probability and harm of phishing attacks.

7702 doesn't improve security and possibly even hurts security in some ways because:

Expand Down Expand Up @@ -165,4 +165,4 @@ Hopefully, **this virtuous cycle of wallets => dapps => users => wallets will dr

In the next article, we will dive deeper into the technical side and examine how exactly wallets and dapps will implement support for 7702.

*Update: we have released a tutorial for [using the ZeroDev SDK with EIP-7702](/sdk/getting-started/quickstart-7702).*
*Update: we have released a tutorial for [using the ZeroDev SDK with EIP-7702](/smart-accounts/eip-7702/quickstart).*
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ bun add @zerodev/multi-chain-ecdsa-validator

### Setting up the Kernel account

First, make sure you know how to [create ZeroDev accounts](/sdk/core-api/create-account).
First, make sure you know how to [create ZeroDev accounts](/smart-accounts/create-a-smart-account).

The flow for creating a chain-abstracted ZeroDev account is the same, with the following exceptions:

Expand Down Expand Up @@ -179,7 +179,7 @@ console.log(`Intent executed on chain: ${receipt?.executionChainId}`);

Here:

- `calls` is a [batch](/sdk/core-api/batch-transactions) of calls to execute atomically.
- `calls` is a [batch](/smart-accounts/batch-transactions) of calls to execute atomically.
- `outputTokens` is the chain-abstracted token that your calls require. For example, if your calls are looking to spend 500 USDC to buy an NFT, then you'd specify 500 USDC with the `outputTokens`.
- If you want to use ETH as the output token, set the address to `zeroAddress`.

Expand Down Expand Up @@ -239,7 +239,7 @@ When using intents, you may use the `gasToken` flag to configure how to pay gas.

- By default (with no `gasToken` specified), gas is paid in CAB (input tokens) itself.
- If you specify `gasToken: 'NATIVE'`, the account will pay gas with the native token (e.g. ETH).
- If you specify `gasToken: 'SPONSORED'`, you will be [sponsoring gas](/sdk/core-api/sponsor-gas) for the account.
- If you specify `gasToken: 'SPONSORED'`, you will be [sponsoring gas](/smart-accounts/sponsor-gas/evm) for the account.
- If you specify `gasToken: 'USDC'` or `gasToken: 'USDT'`, you will pay gas with the specified stablecoin.

### Parallel intent execution
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Supported Base Tokens

This is the full list of base tokens supported by ZeroDev's [DeFi integrations](/sdk/advanced/defi).
This is the full list of base tokens supported by ZeroDev's [DeFi integrations](/advanced/defi).

## Usage

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Supported Defi Tokens

This is the full list of DeFi tokens (aka "vaults") supported by ZeroDev's [DeFi integrations](/sdk/advanced/defi).
This is the full list of DeFi tokens (aka "vaults") supported by ZeroDev's [DeFi integrations](/advanced/defi).

## Usage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@ View completed UserOp here: https://jiffyscan.xyz/userOpHash/0x7a8e0ba961cc0a34f

Congrats -- you just sent your first gasless transaction with ZeroDev!

In this example, you used a public ZeroDev API key. Now read [the tutorial](/sdk/getting-started/tutorial) to see how to set up your own ZeroDev project.
In this example, you used a public ZeroDev API key. Now read [Set up a project](/get-started/sdks/setup-project) to see how to set up your own ZeroDev project, then walk through the full [TypeScript / JavaScript tutorial](/get-started/sdks/client-side/typescript).
Loading