Skip to main content

Custom Integration

If you are using a third-party service to manage private keys, you can integrate it with ZeroDev as long as it provides a signer or an RPC provider interface (or you could implement the interface yourself).

ZeroDev can be easily integrated with any third-party signing service as long as it exposes the proper interface. Specifically, ZeroDev works with any Ethers signer or RPC provider.

Signer

Ethers

import { ECDSAProvider } from '@zerodev/sdk'

const ecdsaProvider = await ECDSAProvider.init({
projectId: "<project id>",
owner: <your signer>,
})

Example using a private key signer:

Full Code (Editable)
Result
Loading...

RPC Provider

Ethers

import { ECDSAProvider, getRPCProviderOwner } from '@zerodev/sdk'

const signer = await ECDSAProvider.init({
projectId: "<project id>",
owner: getRPCProviderOwner(rpcProvider),
})

Example using MetaMask as an owner (only works if you have MetaMask installed):

Full Code (Editable)
Result
Loading...

Wagmi

import { ZeroDevConnector } from '@zerodev/wagmi'

const connector = new ZeroDevConnector({chains, options: {
projectId: <your-project-id>,
owner: getRPCProviderOwner(<provider>),
}})

Example:

Full Code (Editable)
Result
Loading...

You can also "wrap" an existing Wagmi connect with enhanceConnectorWithAA, which will create an AA wallet and use the connector as a signer/owner for the AA wallet.

import { enhanceConnectorWithAA } from '@zerodev/wagmi'
import { MetaMaskConnector } from '@wagmi/core/connectors/metaMask'

const config = createConfig({
connectors: [
enhanceConnectorWithAA(
new MetaMaskConnector({ chains }),
{ projectId: "<your-project-id>" }
),
],
})
Full Code (Editable)
Result
Loading...