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 OneOf,
5 SignableMessage,
6 TypedData,
7 TypedDataDefinition,
8 SignedAuthorization,
9} from "viem";
10
11// [!region SmartAccountAuthenticator]
12/**
13 * Extends the @interface SmartAccountSigner interface with authentication.
14 *
15 * @template AuthParams - the generic type of the authentication parameters
16 * @template AuthDetails - the generic type of the authentication details
17 * @template Inner - the generic type of the inner client that the signer wraps to provide functionality such as signing, etc.
18 */
19export interface SmartAccountAuthenticator<AuthParams, AuthDetails, Inner = any>
20 extends SmartAccountSigner<Inner> {
21 authenticate: (params: AuthParams) => Promise<AuthDetails>;
22
23 getAuthDetails: () => Promise<AuthDetails>;
24}
25// [!endregion SmartAccountAuthenticator]
26
27// [!region SmartAccountSigner]
28// TODO: This is a temporary type to be removed when viem is updated
29export type AuthorizationRequest<uint32 = number> = OneOf<
30 | {
31 address: Address;
32 }
33 | {
34 contractAddress: Address;
35 }
36> & {
37 /** Chain ID. */
38 chainId: uint32;
39 /** Nonce of the EOA to delegate to. */
40 nonce: uint32;
41};
42
43/**
44 * A signer that can sign messages and typed data.
45 *
46 * @template Inner - the generic type of the inner client that the signer wraps to provide functionality such as signing, etc.
47 */
48export interface SmartAccountSigner<Inner = any> {
49 signerType: string;
50 inner: Inner;
51
52 getAddress: () => Promise<Address>;
53
54 signMessage: (message: SignableMessage) => Promise<Hex>;
55
56 signTypedData: <
57 const TTypedData extends TypedData | Record<string, unknown>,
58 TPrimaryType extends keyof TTypedData | "EIP712Domain" = keyof TTypedData,
59 >(
60 params: TypedDataDefinition<TTypedData, TPrimaryType>,
61 ) => Promise<Hex>;
62
63 signAuthorization?: (
64 unsignedAuthorization: AuthorizationRequest<number>,
65 ) => Promise<SignedAuthorization<number>>;
66}
67// [!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);