3rd Party Signers

Account Kit is designed to be flexible and allow you to use any Signer you want. If you choose not use our signer, you can either:

  1. Use a 3rd party library as a Signer that integrates with Account Kit.
  2. Implement SmartAccountSigner (exported in @aa-sdk/core).
  3. If your Signer is an EIP-1193 compliant provider, you can leverage viem’s WalletClient and the WalletClientSigner (exported in @aa-sdk/core).

Then you can use your Signer as an owner on Smart Contracts exported from @account-kit/smart-contracts and with our infra Smart Account Clients exported from @account-kit/infra.

Third Party SDKs

If you’ve built an SDK or Guide that leverages any of the methods below to use as a 3rd Party Signer, we’re happy to include you in this list!

Please open a PR to add a link to your content in this section.

Implementing SmartAccountAuthenticator or SmartAccountSigner

Smart accounts in Account Kit expect an implementation of SmartAccountSigner to work in Account Kit. We also include a SmartAccountAuthenticator interface that extends SmartAccountSigner and wraps any SDKs you may wish to use as part of the implementation of your own Signer.

[types.ts]
1import type { Address } from "abitype";
2import type {
3 Hex,
4 SignableMessage,
5 TypedData,
6 TypedDataDefinition,
7} from "viem";
8import type { Authorization } from "viem/experimental";
9
10// [!region SmartAccountAuthenticator]
11/**
12 * Extends the @interface SmartAccountSigner interface with authentication.
13 *
14 * @template AuthParams - the generic type of the authentication parameters
15 * @template AuthDetails - the generic type of the authentication details
16 * @template Inner - the generic type of the inner client that the signer wraps to provide functionality such as signing, etc.
17 */
18export interface SmartAccountAuthenticator<AuthParams, AuthDetails, Inner = any>
19 extends SmartAccountSigner<Inner> {
20 authenticate: (params: AuthParams) => Promise<AuthDetails>;
21
22 getAuthDetails: () => Promise<AuthDetails>;
23}
24// [!endregion SmartAccountAuthenticator]
25
26// [!region SmartAccountSigner]
27/**
28 * A signer that can sign messages and typed data.
29 *
30 * @template Inner - the generic type of the inner client that the signer wraps to provide functionality such as signing, etc.
31 */
32export interface SmartAccountSigner<Inner = any> {
33 signerType: string;
34 inner: Inner;
35
36 getAddress: () => Promise<Address>;
37
38 signMessage: (message: SignableMessage) => Promise<Hex>;
39
40 signTypedData: <
41 const TTypedData extends TypedData | Record<string, unknown>,
42 TPrimaryType extends keyof TTypedData | "EIP712Domain" = keyof TTypedData
43 >(
44 params: TypedDataDefinition<TTypedData, TPrimaryType>
45 ) => Promise<Hex>;
46
47 signAuthorization?: (
48 unsignedAuthorization: Authorization<number, false>
49 ) => Promise<Authorization<number, true>>;
50}
51// [!endregion SmartAccountSigner]

Using WalletClientSigner

Viem allows you to create a WalletClient, which can be used to wrap local or JSON RPC based wallets. You can see the complete docs for leveraging the WalletClient here.

We support a SmartAccountSigner implementation called WalletClientSigner that makes it really easy to use a viem WalletClient as a signer on your Smart Contract Account. If your Signer is EIP-1193 compliant, it is really easy to use with WalletClient. Let’s take a look at a simple example:

wallet-client-signer.ts
1import { WalletClientSigner, type SmartAccountSigner } from "@aa-sdk/core";
2import { createWalletClient, custom } from "viem";
3import { sepolia } from "viem/chains";
4
5const externalProvider = window.ethereum; // or any other EIP-1193 provider
6
7const walletClient = createWalletClient({
8 chain: sepolia, // can provide a different chain here
9 transport: custom(externalProvider),
10});
11
12export const signer: SmartAccountSigner = new WalletClientSigner(
13 walletClient,
14 "json-rpc" // signerType
15);