# InvalidLengthError

[**types/public\_key**](..) • **Docs**

***

[near-sdk-js v2.0.0](../../../packages) / [types/public\_key](..) / InvalidLengthError

## Class: InvalidLengthError

### Extends

* [`ParsePublicKeyError`](parsepublickeyerror)

### Constructors

#### new InvalidLengthError()

> **new InvalidLengthError**(`length`, `expectedLength`): [`InvalidLengthError`](invalidlengtherror)

**Parameters**

• **length**: `number`

• **expectedLength**: `number`

**Returns**

[`InvalidLengthError`](invalidlengtherror)

**Overrides**

[`ParsePublicKeyError`](parsepublickeyerror).[`constructor`](../parsepublickeyerror#constructors)

**Defined in**

[packages/near-sdk-js/src/types/public\_key.ts:63](https://github.com/near/near-sdk-js/blob/b58ac04fc6dff2f1120e9098c0cb059493486598/packages/near-sdk-js/src/types/public_key.ts#L63)

### Properties

#### cause?

> `optional` **cause**: `Error`

**Inherited from**

[`ParsePublicKeyError`](parsepublickeyerror).[`cause`](../parsepublickeyerror#cause)

**Defined in**

node\_modules/.pnpm/typescript@4.7.4/node\_modules/typescript/lib/lib.es2022.error.d.ts:26

***

#### expectedLength

> **expectedLength**: `number`

**Defined in**

[packages/near-sdk-js/src/types/public\_key.ts:63](https://github.com/near/near-sdk-js/blob/b58ac04fc6dff2f1120e9098c0cb059493486598/packages/near-sdk-js/src/types/public_key.ts#L63)

***

#### length

> **length**: `number`

**Defined in**

[packages/near-sdk-js/src/types/public\_key.ts:63](https://github.com/near/near-sdk-js/blob/b58ac04fc6dff2f1120e9098c0cb059493486598/packages/near-sdk-js/src/types/public_key.ts#L63)

***

#### message

> **message**: `string`

**Inherited from**

[`ParsePublicKeyError`](parsepublickeyerror).[`message`](../parsepublickeyerror#message)

**Defined in**

node\_modules/.pnpm/typescript@4.7.4/node\_modules/typescript/lib/lib.es5.d.ts:1029

***

#### name

> **name**: `string`

**Inherited from**

[`ParsePublicKeyError`](parsepublickeyerror).[`name`](../parsepublickeyerror#name)

**Defined in**

node\_modules/.pnpm/typescript@4.7.4/node\_modules/typescript/lib/lib.es5.d.ts:1028

***

#### stack?

> `optional` **stack**: `string`

**Inherited from**

[`ParsePublicKeyError`](parsepublickeyerror).[`stack`](../parsepublickeyerror#stack)

**Defined in**

node\_modules/.pnpm/typescript@4.7.4/node\_modules/typescript/lib/lib.es5.d.ts:1030

***

#### prepareStackTrace()?

> `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any`

Optional override for formatting stack traces

**Parameters**

• **err**: `Error`

• **stackTraces**: `CallSite`\[]

**Returns**

`any`

**See**

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

**Inherited from**

[`ParsePublicKeyError`](parsepublickeyerror).[`prepareStackTrace`](../parsepublickeyerror#preparestacktrace)

**Defined in**

packages/near-sdk-js/node\_modules/@types/node/globals.d.ts:11

***

#### stackTraceLimit

> `static` **stackTraceLimit**: `number`

**Inherited from**

[`ParsePublicKeyError`](parsepublickeyerror).[`stackTraceLimit`](../parsepublickeyerror#stacktracelimit)

**Defined in**

packages/near-sdk-js/node\_modules/@types/node/globals.d.ts:13

### Methods

#### captureStackTrace()

> `static` **captureStackTrace**(`targetObject`, `constructorOpt`?): `void`

Create .stack property on a target object

**Parameters**

• **targetObject**: `object`

• **constructorOpt?**: `Function`

**Returns**

`void`

**Inherited from**

[`ParsePublicKeyError`](parsepublickeyerror).[`captureStackTrace`](../parsepublickeyerror#capturestacktrace)

**Defined in**

packages/near-sdk-js/node\_modules/@types/node/globals.d.ts:4
