-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Property 'authorizationList' is missing in type #3915
Description
Check existing issues
- I checked there isn't already an issue for the bug I encountered.
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