# Interface EncoderSettings

This type contains information needed to initialize the encoder.

#### Category

Inputs

#### Hierarchy

- EncoderSettings

- Defined in encoder/lib/types.ts:71

#####
Index

### Properties

ens?
networkId?
projectInfo?
provider?

## Properties

### `Optional` ens

ens?: EnsSettings

This field can be included to enable or disable ENS resolution and specify how it should be performed. If absent, but a provider was given above, ENS resolution will be performed using that.

- Defined in encoder/lib/types.ts:117

### `Optional` networkId

networkId?: number

Optionally include a network ID; this is used for the same purposes as the provider (see above), but won't turn on ENS resolution.

There is no need to include this when using a Truffle Contract based constructor, as it will use the contract's network ID, but if you do include it, it will override that network ID.

If this is passed in addition to provider, this network ID will override the one from provider.

- Defined in encoder/lib/types.ts:111

### `Optional` projectInfo

projectInfo?: Compilations.ProjectInfo

Information about the project or contracts being decoded. This may come in several forms; see the type documentation for more information. The simplest way to use this to set it to `{ artifacts: <array of artifacts in project> }`.

This may be left out if an artifact or contract has been passed in by some other means, in which case the encoder will be made based purely on that single contract, but it's recommended to pass in project info for all your contracts to get the encoder's full power.

- Defined in encoder/lib/types.ts:83

### `Optional` provider

provider?: Provider

Optionally include a provider; if given, this allows the encoder to know the current network ID and thereby perform any necessary library linking when encoding a contract creation. If you attempt to encode a contract creation transaction for a contract that still has unlinked libraries, and do not provide the information needed to link them, an exception will be thrown.

There is no need to include this when using a Truffle Contract based constructor, as it will use the contract's provider, but if you do include it, it will override that provider.

Including this will also turn on ENS resolution unless it is turned off in the ENS settings (see below).

- Defined in encoder/lib/types.ts:99

Generated using TypeDoc