Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify function type signatures #198

Merged
merged 2 commits into from
Sep 9, 2021
Merged

Simplify function type signatures #198

merged 2 commits into from
Sep 9, 2021

Commits on Sep 9, 2021

  1. Simplify function type signatures

    The type signatures of many public functions were complex and
    misleading. This was primarily due to the widespread use of the types
    `TypedData` and `TypedMessage<T>`, which where inappropriate in most of
    the places they were used.
    
    The `TypedMessage<T>` type is used by the `signTypedData` function when
    the version is 'V3' or 'V4'. All references to this type outside of V3
    and V4 of `signTypedData` have been removed. This also resulted in the
    `T` generic parameter being removed from many functions.
    
    The `TypedData` type didn't represent the actual type signature of any
    function, yet it was used to represent the input data for most
    functions. In most cases we had no specific expectations for the input
    type, so `unknown` is now used instead. In the case of `V1` of
    `signTypedData`, the expected type was always `EIP712TypedData[]`. The
    `TypedData` type has been reduced to just that one case where it was
    useful and accurate.
    Gudahtt committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    0c436aa View commit details
    Browse the repository at this point in the history
  2. Rename TypedData to TypedDataV1 and add docs

    The `TypedData` type has been renamed to `TypedDataV1` to indicate that
    this type is only intended to represent the data being signed with `V1`
    of `signTypedData`.
    
    JSDoc documentation has been added for the two message types,
    `SignTypedDataV1Data` and `TypedMessage`.
    Gudahtt committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    2bdde6b View commit details
    Browse the repository at this point in the history