Skip to content

Support viem@^2.23.12 in @alchemy/aa-accounts for Berachain compatibility #1461

@nguyennhukhanh

Description

@nguyennhukhanh

[REQUIRED] Environment

  • AA SDK version: ^3.19.0
  • Package: @alchemy/aa-accounts

[REQUIRED] Describe the problem
The current version of @alchemy/aa-accounts does not support Berachain from viem@^2.23.12, causing a TypeScript error when attempting to use it in an aa-wallet module.

** How to reproduce:**

  1. Install the latest @alchemy/aa-accounts and viem@^2.23.12.
  2. Import Berachain from viem/chains:
    import { berachain } from 'viem/chains';
  3. Attempt to create a light account using createLightAccount with Berachain:
    const account = await createLightAccount({
        transport: transport,
        chain: berachain,
        signer,
    });
  4. This results in a TypeScript error related to the chain property.

** Relevant code or sample repro:**

import { createLightAccount } from '@alchemy/aa-accounts';
import { createAlchemySmartAccountClient } from '@alchemy/aa-alchemy';
import { LocalAccountSigner } from '@alchemy/aa-core';
import { berachain } from 'viem/chains';

const account = await createLightAccount({
    transport: transport,
    chain: berachain,
    signer,
});

** Expected Behavior**
The package should support Berachain from viem@^2.23.12 without type conflicts.

** Actual Behavior**
The following TypeScript error occurs:

Type '{ blockExplorers: { readonly default: { readonly name: "Berascan"; readonly url: "https://berascan.com"; }; }; contracts: { readonly multicall3: { readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11"; readonly blockCreated: 0; }; readonly ensRegistry: { ...; }; readonly ensUniversalResolver: { ...; }; }; ....' is not assignable to type 'Chain'.

** Suggested Fix**
Please update @alchemy/aa-accounts to support viem@^2.23.12 and ensure compatibility with Berachain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions