pimlicolabs / permissionless.js

TypeScript utilities built on viem for ERC-4337: Account Abstraction
https://docs.pimlico.io/permissionless
MIT License
172 stars 53 forks source link

`viem` version for 2.19.x #272

Closed enesozturk closed 1 month ago

enesozturk commented 2 months ago

Hey there,

We are using permissionless in our project, web3modal. Currently, we noticed that permissionless specifies a restricted range of viem versions in its package.json:

"peerDependencies": {
     "viem": ">=2.14.1 <2.18.0"
}

However, the viem library has recently released versions beyond this range (e.g., 2.19.x). When we try to use these newer versions of viem, we encounter type mismatch errors related to permissionless.

Type 'SmartAccount<EntryPoint>' is not assignable to type '`0x${string}` | Account | undefined'.
  Type 'SmartAccount<EntryPoint>' is not assignable to type '{ address: `0x${string}`; nonceManager?: NonceManager | undefined; sign?: ((parameters: { hash: `0x${string}`; }) => Promise<`0x${string}`>) | undefined; experimental_signAuthorization?: ((parameters: Authorization) => Promise<...>) | undefined; ... 16 more ...; isDeployed?: undefined; }'.
    Types of property 'nonceManager' are incompatible.
      Type 'import("/{PROJECT_PATH}/node_modules/.pnpm/viem@2.19.6_bufferutil@4.0.8_typescript@5.3.3_utf-8-validate@5.0.10_zod@3.22.4/node_modules/viem/_types/utils/nonceManager").NonceManager | undefined' is not assignable to type 'import("/{PROJECT_PATH}/node_modules/.pnpm/viem@2.19.6_bufferutil@4.0.8_typescript@5.3.3_utf-8-validate@5.0.10_zod@3.22.4/node_modules/viem/utils/nonceManager").NonceManager | undefined'.
        Type 'import("/{PROJECT_PATH}/node_modules/.pnpm/viem@2.19.6_bufferutil@4.0.8_typescript@5.3.3_utf-8-validate@5.0.10_zod@3.22.4/node_modules/viem/_types/utils/nonceManager").NonceManager' is not assignable to type 'import("/{PROJECT_PATH}/node_modules/.pnpm/viem@2.19.6_bufferutil@4.0.8_typescript@5.3.3_utf-8-validate@5.0.10_zod@3.22.4/node_modules/viem/utils/nonceManager").NonceManager'.
          Types of property 'consume' are incompatible.
            Type '(parameters: FunctionParameters & { client: import("/{PROJECT_PATH}/node_modules/.pnpm/viem@2.19.6_bufferutil@4.0.8_typescript@5.3.3_utf-8-validate@5.0.10_zod@3.22.4/node_modules/viem/_types/clients/createClient").Client; }) => Promise<...>' is not assignable to type '(parameters: FunctionParameters & { client: import("/{PROJECT_PATH}/node_modules/.pnpm/viem@2.19.6_bufferutil@4.0.8_typescript@5.3.3_utf-8-validate@5.0.10_zod@3.22.4/node_modules/viem/clients/createClient").Client; }) => Promise<...>'.
              Types of parameters 'parameters' and 'parameters' are incompatible.
                Type 'FunctionParameters & { client: import("/{PROJECT_PATH}/node_modules/.pnpm/viem@2.19.6_bufferutil@4.0.8_typescript@5.3.3_utf-8-validate@5.0.10_zod@3.22.4/node_modules/viem/clients/createClient").Client; }' is not assignable to type 'FunctionParameters & { client: import("/{PROJECT_PATH}/node_modules/.pnpm/viem@2.19.6_bufferutil@4.0.8_typescript@5.3.3_utf-8-validate@5.0.10_zod@3.22.4/node_modules/viem/_types/clients/createClient").Client; }'.
                  Type 'FunctionParameters & { client: Client; }' is not assignable to type '{ client: Client; }'.
                    Types of property 'client' are incompatible.
                      Type 'import("/{PROJECT_PATH}/node_modules/.pnpm/viem@2.19.6_bufferutil@4.0.8_typescript@5.3.3_utf-8-validate@5.0.10_zod@3.22.4/node_modules/viem/clients/createClient").Client' is not assignable to type 'import("/{PROJECT_PATH}/node_modules/.pnpm/viem@2.19.6_bufferutil@4.0.8_typescript@5.3.3_utf-8-validate@5.0.10_zod@3.22.4/node_modules/viem/_types/clients/createClient").Client'.ts(2322)
createClient.ts(36, 3): The expected type comes from property 'account' which is declared here on type '{ account?: `0x${string}` | Account | undefined; cacheTime?: number | undefined; ccipRead?: false | { request?: ((parameters: CcipRequestParameters) => Promise<...>) | undefined; } | undefined; ... 5 more ...; rpcSchema?: undefined; }'

Could you please update permissionless to support the latest versions of viem? This would help ensure compatibility and allow us to use the most recent features and fixes from viem.

Best

freeatnet commented 2 months ago

Looks like 0.2.0 is the answer here 🎉

Worth noting that not all consumers of permissionless may have upgraded yet (e.g., https://github.com/zerodevapp/sdk/commit/89739b1b6c6fcec121e2683dd0a35848e910c627).