Skip to content

Type error: destructuring from undefined in Authorization.ts #101

@dan1kov

Description

@dan1kov

Ox Version

0.8.8

Current Behavior

In src/core/Authorization.ts#L270-L276, the code attempts to spread ...signature, where signature can be undefined:

const signature =
yParity && r && s ? Signature.fromTuple([yParity, r, s]) : undefined
return from({
address,
chainId: chainId === '0x' ? 0 : Number(chainId),
nonce: nonce === '0x' ? 0n : BigInt(nonce),
...signature,

This causes a TypeScript compilation error because object spread cannot destructure undefined.

Image

Expected Behavior

no type errors

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