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

Fix various mistakes in the README API documentation #157

Merged
merged 3 commits into from
Jul 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,37 +36,39 @@ msgParams should have a `data` key that is hex-encoded data unsigned, and a `sig

Returns a hex-encoded sender address.

### signTypedData (privateKeyBuffer, msgParams)
### signTypedDataLegacy (privateKeyBuffer, msgParams)

Signs typed data as per [an early draft of EIP 712](https://github.com/ethereum/EIPs/pull/712/commits/21abe254fe0452d8583d5b132b1d7be87c0439ca).

Data should be under `data` key of `msgParams`. The method returns prefixed signature.

### signTypedData_v3 (privateKeyBuffer, msgParams)
### signTypedData (privateKeyBuffer, msgParams)

Signs typed data as per the published version of [EIP 712](https://github.com/ethereum/EIPs/pull/712).
Signs typed data as per [EIP 712](https://github.com/ethereum/EIPs/pull/712), except that arrays and recursive data structures are not supported.

Data should be under `data` key of `msgParams`. The method returns prefixed signature.

### signTypedData_v4 (privateKeyBuffer, msgParams)

Signs typed data as per an extension of the published version of [EIP 712](https://github.com/MetaMask/eth-sig-util/pull/54).

This extension adds support for arrays and recursive data types.
Signs typed data as per [EIP 712](https://github.com/MetaMask/eth-sig-util/pull/54), including support for arrays and recursive data types.

Data should be under `data` key of `msgParams`. The method returns prefixed signature.

### recoverTypedSignature ({data, sig})
### recoverTypedSignatureLegacy ({data, sig})

Return address of a signer that did `signTypedData`.
Recover the address of the account used to sign the provided signature. The signature should be of the same type produced by `signTypedDataLegacy`.

Expects the same data that were used for signing. `sig` is a prefixed signature.

### recoverTypedSignature_V4 ({data, sig})
### recoverTypedSignature ({data, sig})

Recover the address of the account used to sign the provided signature. The signature should be of the same type produced by `signTypedData`.

Expects the same data that were used for signing. `sig` is a prefixed signature.

Return address of a signer that did `signTypedData` as per an extension of the published version of [EIP 712](https://github.com/MetaMask/eth-sig-util/pull/54).
### recoverTypedSignature_v4 ({data, sig})

This extension adds support for arrays and recursive data types.
Recover the address of the account used to sign the provided signature. The signature should be of the same type produced by `signTypedData_v4`.

Expects the same data that were used for signing. `sig` is a prefixed signature.

Expand Down