Skip to content

Signature

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:32

A Signature

@_docloc: api/crypto:Signing

get _s(): string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:55

Return the s value, unchecked for EIP-2 compliance.

This should generally not be used and is for situations where a non-canonical S value might be relevant, such as Frontier blocks that were mined prior to EIP-2 or invalid Authorization List signatures.

string


get compactSerialized(): string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:96

The [[link-eip-2098]] compact representation.

string


get legacyChainId(): null | bigint;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:81

The chain ID for EIP-155 legacy transactions. For non-legacy transactions, this value is null.

null | bigint


get networkV(): null | bigint;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:76

The EIP-155 v for legacy transactions. For non-legacy transactions, this value is null.

null | bigint


get r(): string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:40

The r value for a signature.

This represents the x coordinate of a “reference” or challenge point, from which the y can be computed.

string

set r(value): void;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:41

ParameterType
valueBytesLike

void


get s(): string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:45

The s value for a signature.

string

set s(_value): void;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:46

ParameterType
_valueBytesLike

void


get serialized(): string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:100

The serialized representation.

string


get v(): 27 | 28;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:70

The 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.

27 | 28

set v(value): void;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:71

ParameterType
valueBigNumberish

void


get yParity(): 0 | 1;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:87

The yParity for the signature.

See v for more details on how this value is used.

0 | 1


get yParityAndS(): string;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:92

The [[link-eip-2098]] compact representation of the yParity and s compacted into a single bytes32.

string

clone(): Signature;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:108

Returns a new identical [[Signature]].

Signature


isValid(): boolean;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:59

Returns true if the Signature is valid for [[link-eip-2]] signatures.

boolean


toJSON(): any;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:112

Returns a representation that is compatible with JSON.stringify.

any


static from(sig?): Signature;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:169

Creates a new [[Signature]].

If no %%sig%% is provided, a new [[Signature]] is created with default values.

If %%sig%% is a string, it is parsed.

ParameterType
sig?SignatureLike

Signature


static getChainId(v): bigint;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:123

Compute the chain ID from the v in a legacy EIP-155 transactions.

@example: Signature.getChainId(45) //_result:

Signature.getChainId(46) //_result:

ParameterType
vBigNumberish

bigint


static getChainIdV(chainId, v): bigint;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:138

Compute the v for a chain ID for a legacy EIP-155 transactions.

Legacy transactions which use [[link-eip-155]] hijack the v property to include the chain ID.

@example: Signature.getChainIdV(5, 27) //_result:

Signature.getChainIdV(5, 28) //_result:

ParameterType
chainIdBigNumberish
v27 | 28

bigint


static getNormalizedV(v): 27 | 28;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/crypto/signature.d.ts:160

Compute the normalized legacy transaction v from a yParirty, a legacy transaction v or a legacy [[link-eip-155]] transaction.

@example: // The values 0 and 1 imply v is actually yParity Signature.getNormalizedV(0) //_result:

// Legacy non-EIP-1559 transaction (i.e. 27 or 28) Signature.getNormalizedV(27) //_result:

// Legacy EIP-155 transaction (i.e. >= 35) Signature.getNormalizedV(46) //_result:

// Invalid values throw Signature.getNormalizedV(5) //_error:

ParameterType
vBigNumberish

27 | 28