Skip to content

Property 'authorizationList' is missing in type #3915

@shm0x

Description

@shm0x

Check existing issues

Viem Version

>2.35.1

Current Behavior

When trying to use readContract, i got this typescript error:

Property 'authorizationList' is missing in type '{ abi: readonly [{ readonly type: "function"; readonly name: "totalSupply"; readonly inputs: readonly []; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, ... 152 more ..., { ...; }]; address: 0x${string}; functionName: "totalSupply"; blockNumber: bigint; }' but required in type '{ account?: 0x${string} | Account; authorizationList: any; blockNumber?: bigint; blockTag?: BlockTag; factory?: 0x${string}; factoryData?: 0x${string}; stateOverride?: StateOverride; }'

Seems the issue come from here:

export type TransactionRequest<quantity = bigint, index = number> = OneOf<
  | TransactionRequestLegacy<quantity, index>
  | TransactionRequestEIP2930<quantity, index>
  | TransactionRequestEIP1559<quantity, index>
  | TransactionRequestEIP4844<quantity, index>
  | TransactionRequestEIP7702<quantity, index>
>

Where all transactions type except TransactionRequestEIP7702 have an optional authorizationList property, but required for EIP7702.

It's working fine in version <= 2.35.0.

Expected Behavior

It should narrow the correct transaction type when not using any EIP7702 transaction

Steps To Reproduce

Check minimal reproductible link

Link to Minimal Reproducible Example

https://stackblitz.com/edit/viem-getting-started-1rhmcgka?file=src%2Findex.ts

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions