TODO
Accessors
compactSerialized
Returns
string
Source
crypto/signature.ts:161legacyChainId
null.
Returns
null | bigint
Source
crypto/signature.ts:128networkV
v for legacy transactions. For non-legacy transactions, this value is null.
Returns
null | bigint
Source
crypto/signature.ts:121r
r value for a signautre.
This represents the x coordinate of a “reference” or challenge point, from which the y can be computed.
Returns
string
Source
crypto/signature.ts:80s
s value for a signature.
Returns
string
Source
crypto/signature.ts:91serialized
Returns
string
Source
crypto/signature.ts:168v
v value for a signature.
Since a given x value for r has two possible values for its correspondin y, the v indicates which of the
two y values to use.
It is normalized to the values 27 or 28 for legacy purposes.
Returns
27 | 28
Source
crypto/signature.ts:109yParity
yParity for the signature.
See v for more details on how this value is used.
Returns
0 | 1
Source
crypto/signature.ts:141yParityAndS
yParity and s compacted
into a single bytes32.
Returns
string
Source
crypto/signature.ts:149Methods
clone()
Returns
Signature
Source
crypto/signature.ts:190toJSON()
JSON.stringify.
Returns
any
Source
crypto/signature.ts:201from()
sig is provided, a new Signature is created with default values.
If sig is a string, it is parsed.
Parameters
| Parameter | Type | Description |
|---|---|---|
sig? | SignatureLike | The signature to create. |
Returns
Signature
The new signature.
Source
crypto/signature.ts:312getChainId()
v in a legacy EIP-155 transactions.
Parameters
| Parameter | Type | Description |
|---|---|---|
v | BigNumberish | The v value from the signature. |
Returns
bigint
The chain ID.
Example
Source
crypto/signature.ts:226getChainIdV()
v for a chain ID for a legacy EIP-155 transactions.
Legacy transactions which use EIP-155 hijack the v property to
include the chain ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
chainId | BigNumberish | The chain ID. |
v | 27 | 28 | The v value. |
Returns
bigint
The v value.
Example
Source
crypto/signature.ts:258getNormalizedV()
v from a yParirty, a legacy transaction v or a legacy
EIP-155 transaction.
Parameters
| Parameter | Type | Description |
|---|---|---|
v | BigNumberish | The v value. |
Returns
27 | 28
The normalized v value.
Example
Throws
Thrown if thev is invalid.
